OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2008 the V8 project authors. All rights reserved. | 3 # Copyright 2008 the V8 project authors. All rights reserved. |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 # ------------------------- | 319 # ------------------------- |
320 | 320 |
321 | 321 |
322 class CommandOutput(object): | 322 class CommandOutput(object): |
323 | 323 |
324 def __init__(self, exit_code, timed_out, stdout, stderr): | 324 def __init__(self, exit_code, timed_out, stdout, stderr): |
325 self.exit_code = exit_code | 325 self.exit_code = exit_code |
326 self.timed_out = timed_out | 326 self.timed_out = timed_out |
327 self.stdout = stdout | 327 self.stdout = stdout |
328 self.stderr = stderr | 328 self.stderr = stderr |
| 329 self.failed = None |
329 | 330 |
330 | 331 |
331 class TestCase(object): | 332 class TestCase(object): |
332 | 333 |
333 def __init__(self, context, path): | 334 def __init__(self, context, path): |
334 self.path = path | 335 self.path = path |
335 self.context = context | 336 self.context = context |
336 self.failed = None | |
337 self.duration = None | 337 self.duration = None |
338 | 338 |
339 def IsNegative(self): | 339 def IsNegative(self): |
340 return False | 340 return False |
341 | 341 |
342 def CompareTime(self, other): | 342 def CompareTime(self, other): |
343 return cmp(other.duration, self.duration) | 343 return cmp(other.duration, self.duration) |
344 | 344 |
345 def DidFail(self, output): | 345 def DidFail(self, output): |
346 if self.failed is None: | 346 if output.failed is None: |
347 self.failed = self.IsFailureOutput(output) | 347 output.failed = self.IsFailureOutput(output) |
348 return self.failed | 348 return output.failed |
349 | 349 |
350 def IsFailureOutput(self, output): | 350 def IsFailureOutput(self, output): |
351 return output.exit_code != 0 | 351 return output.exit_code != 0 |
352 | 352 |
353 def GetSource(self): | 353 def GetSource(self): |
354 return "(no source available)" | 354 return "(no source available)" |
355 | 355 |
356 def RunCommand(self, command): | 356 def RunCommand(self, command): |
357 full_command = self.context.processor(command) | 357 full_command = self.context.processor(command) |
358 output = Execute(full_command, self.context, self.context.timeout) | 358 output = Execute(full_command, self.context, self.context.timeout) |
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1346 for entry in timed_tests[:20]: | 1346 for entry in timed_tests[:20]: |
1347 t = FormatTime(entry.duration) | 1347 t = FormatTime(entry.duration) |
1348 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) | 1348 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) |
1349 index += 1 | 1349 index += 1 |
1350 | 1350 |
1351 return result | 1351 return result |
1352 | 1352 |
1353 | 1353 |
1354 if __name__ == '__main__': | 1354 if __name__ == '__main__': |
1355 sys.exit(Main()) | 1355 sys.exit(Main()) |
OLD | NEW |