| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 help="Regard pass|fail tests (run|skip|dontcare)", | 199 help="Regard pass|fail tests (run|skip|dontcare)", |
| 200 default="dontcare") | 200 default="dontcare") |
| 201 result.add_option("--gc-stress", | 201 result.add_option("--gc-stress", |
| 202 help="Switch on GC stress mode", | 202 help="Switch on GC stress mode", |
| 203 default=False, action="store_true") | 203 default=False, action="store_true") |
| 204 result.add_option("--command-prefix", | 204 result.add_option("--command-prefix", |
| 205 help="Prepended to each shell command used to run a test", | 205 help="Prepended to each shell command used to run a test", |
| 206 default="") | 206 default="") |
| 207 result.add_option("--download-data", help="Download missing test suite data", | 207 result.add_option("--download-data", help="Download missing test suite data", |
| 208 default=False, action="store_true") | 208 default=False, action="store_true") |
| 209 result.add_option("--download-data-only", |
| 210 help="Download missing test suite data and exit", |
| 211 default=False, action="store_true") |
| 209 result.add_option("--extra-flags", | 212 result.add_option("--extra-flags", |
| 210 help="Additional flags to pass to each test command", | 213 help="Additional flags to pass to each test command", |
| 211 default="") | 214 default="") |
| 212 result.add_option("--isolates", help="Whether to test isolates", | 215 result.add_option("--isolates", help="Whether to test isolates", |
| 213 default=False, action="store_true") | 216 default=False, action="store_true") |
| 214 result.add_option("-j", help="The number of parallel tasks to run", | 217 result.add_option("-j", help="The number of parallel tasks to run", |
| 215 default=0, type="int") | 218 default=0, type="int") |
| 216 result.add_option("-m", "--mode", | 219 result.add_option("-m", "--mode", |
| 217 help="The test modes in which to run (comma-separated)", | 220 help="The test modes in which to run (comma-separated)", |
| 218 default="release,debug") | 221 default="release,debug") |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 args_suites[arg.split(os.path.sep)[0]] = True | 481 args_suites[arg.split(os.path.sep)[0]] = True |
| 479 suite_paths = [ s for s in args_suites if s in suite_paths ] | 482 suite_paths = [ s for s in args_suites if s in suite_paths ] |
| 480 | 483 |
| 481 suites = [] | 484 suites = [] |
| 482 for root in suite_paths: | 485 for root in suite_paths: |
| 483 suite = testsuite.TestSuite.LoadTestSuite( | 486 suite = testsuite.TestSuite.LoadTestSuite( |
| 484 os.path.join(workspace, "test", root)) | 487 os.path.join(workspace, "test", root)) |
| 485 if suite: | 488 if suite: |
| 486 suites.append(suite) | 489 suites.append(suite) |
| 487 | 490 |
| 488 if options.download_data: | 491 if options.download_data or options.download_data_only: |
| 489 for s in suites: | 492 for s in suites: |
| 490 s.DownloadData() | 493 s.DownloadData() |
| 491 | 494 |
| 495 if options.download_data_only: |
| 496 return exit_code |
| 497 |
| 492 for (arch, mode) in options.arch_and_mode: | 498 for (arch, mode) in options.arch_and_mode: |
| 493 try: | 499 try: |
| 494 code = Execute(arch, mode, args, options, suites, workspace) | 500 code = Execute(arch, mode, args, options, suites, workspace) |
| 495 except KeyboardInterrupt: | 501 except KeyboardInterrupt: |
| 496 return 2 | 502 return 2 |
| 497 exit_code = exit_code or code | 503 exit_code = exit_code or code |
| 498 return exit_code | 504 return exit_code |
| 499 | 505 |
| 500 | 506 |
| 501 def Execute(arch, mode, args, options, suites, workspace): | 507 def Execute(arch, mode, args, options, suites, workspace): |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 exit_code = runner.Run(options.j) | 647 exit_code = runner.Run(options.j) |
| 642 overall_duration = time.time() - start_time | 648 overall_duration = time.time() - start_time |
| 643 | 649 |
| 644 if options.time: | 650 if options.time: |
| 645 verbose.PrintTestDurations(suites, overall_duration) | 651 verbose.PrintTestDurations(suites, overall_duration) |
| 646 return exit_code | 652 return exit_code |
| 647 | 653 |
| 648 | 654 |
| 649 if __name__ == "__main__": | 655 if __name__ == "__main__": |
| 650 sys.exit(Main()) | 656 sys.exit(Main()) |
| OLD | NEW |