| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2012 the V8 project authors. All rights reserved. | 3 # Copyright 2012 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 suite = testsuite.TestSuite.LoadTestSuite( | 322 suite = testsuite.TestSuite.LoadTestSuite( |
| 323 os.path.join(workspace, "test", root)) | 323 os.path.join(workspace, "test", root)) |
| 324 if suite: | 324 if suite: |
| 325 suites.append(suite) | 325 suites.append(suite) |
| 326 | 326 |
| 327 if options.download_data: | 327 if options.download_data: |
| 328 for s in suites: | 328 for s in suites: |
| 329 s.DownloadData() | 329 s.DownloadData() |
| 330 | 330 |
| 331 for (arch, mode) in options.arch_and_mode: | 331 for (arch, mode) in options.arch_and_mode: |
| 332 code = Execute(arch, mode, args, options, suites, workspace) | 332 try: |
| 333 code = Execute(arch, mode, args, options, suites, workspace) |
| 334 except KeyboardInterrupt: |
| 335 return 2 |
| 333 exit_code = exit_code or code | 336 exit_code = exit_code or code |
| 334 return exit_code | 337 return exit_code |
| 335 | 338 |
| 336 | 339 |
| 337 def Execute(arch, mode, args, options, suites, workspace): | 340 def Execute(arch, mode, args, options, suites, workspace): |
| 338 print(">>> Running tests for %s.%s" % (arch, mode)) | 341 print(">>> Running tests for %s.%s" % (arch, mode)) |
| 339 | 342 |
| 340 shell_dir = options.shell_dir | 343 shell_dir = options.shell_dir |
| 341 if not shell_dir: | 344 if not shell_dir: |
| 342 if options.buildbot: | 345 if options.buildbot: |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 runner = network_execution.NetworkedRunner(suites, progress_indicator, | 445 runner = network_execution.NetworkedRunner(suites, progress_indicator, |
| 443 ctx, peers, workspace) | 446 ctx, peers, workspace) |
| 444 else: | 447 else: |
| 445 runner = execution.Runner(suites, progress_indicator, ctx) | 448 runner = execution.Runner(suites, progress_indicator, ctx) |
| 446 | 449 |
| 447 exit_code = runner.Run(options.j) | 450 exit_code = runner.Run(options.j) |
| 448 if runner.terminate: | 451 if runner.terminate: |
| 449 return exit_code | 452 return exit_code |
| 450 overall_duration = time.time() - start_time | 453 overall_duration = time.time() - start_time |
| 451 except KeyboardInterrupt: | 454 except KeyboardInterrupt: |
| 452 return 1 | 455 raise |
| 453 | 456 |
| 454 if options.time: | 457 if options.time: |
| 455 verbose.PrintTestDurations(suites, overall_duration) | 458 verbose.PrintTestDurations(suites, overall_duration) |
| 456 return exit_code | 459 return exit_code |
| 457 | 460 |
| 458 | 461 |
| 459 if __name__ == "__main__": | 462 if __name__ == "__main__": |
| 460 sys.exit(Main()) | 463 sys.exit(Main()) |
| OLD | NEW |