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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 help="Run without test harness of a given suite", | 272 help="Run without test harness of a given suite", |
273 default=False, action="store_true") | 273 default=False, action="store_true") |
274 result.add_option("--no-i18n", "--noi18n", | 274 result.add_option("--no-i18n", "--noi18n", |
275 help="Skip internationalization tests", | 275 help="Skip internationalization tests", |
276 default=False, action="store_true") | 276 default=False, action="store_true") |
277 result.add_option("--no-network", "--nonetwork", | 277 result.add_option("--no-network", "--nonetwork", |
278 help="Don't distribute tests on the network", | 278 help="Don't distribute tests on the network", |
279 default=(utils.GuessOS() != "linux"), | 279 default=(utils.GuessOS() != "linux"), |
280 dest="no_network", action="store_true") | 280 dest="no_network", action="store_true") |
281 result.add_option("--no-presubmit", "--nopresubmit", | 281 result.add_option("--no-presubmit", "--nopresubmit", |
282 help='Skip presubmit checks', | 282 help='Skip presubmit checks (deprecated)', |
283 default=False, dest="no_presubmit", action="store_true") | 283 default=False, dest="no_presubmit", action="store_true") |
284 result.add_option("--no-snap", "--nosnap", | 284 result.add_option("--no-snap", "--nosnap", |
285 help='Test a build compiled without snapshot.', | 285 help='Test a build compiled without snapshot.', |
286 default=False, dest="no_snap", action="store_true") | 286 default=False, dest="no_snap", action="store_true") |
287 result.add_option("--no-sorting", "--nosorting", | 287 result.add_option("--no-sorting", "--nosorting", |
288 help="Don't sort tests according to duration of last run.", | 288 help="Don't sort tests according to duration of last run.", |
289 default=False, dest="no_sorting", action="store_true") | 289 default=False, dest="no_sorting", action="store_true") |
290 result.add_option("--no-stress", "--nostress", | 290 result.add_option("--no-stress", "--nostress", |
291 help="Don't run crankshaft --always-opt --stress-op test", | 291 help="Don't run crankshaft --always-opt --stress-op test", |
292 default=False, dest="no_stress", action="store_true") | 292 default=False, dest="no_stress", action="store_true") |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 return False | 478 return False |
479 | 479 |
480 # Store the final configuration in arch_and_mode list. Don't overwrite | 480 # Store the final configuration in arch_and_mode list. Don't overwrite |
481 # predefined arch_and_mode since it is more expressive than arch and mode. | 481 # predefined arch_and_mode since it is more expressive than arch and mode. |
482 if not options.arch_and_mode: | 482 if not options.arch_and_mode: |
483 options.arch_and_mode = itertools.product(options.arch, options.mode) | 483 options.arch_and_mode = itertools.product(options.arch, options.mode) |
484 | 484 |
485 # Special processing of other options, sorted alphabetically. | 485 # Special processing of other options, sorted alphabetically. |
486 | 486 |
487 if options.buildbot: | 487 if options.buildbot: |
488 # Buildbots run presubmit tests as a separate step. | |
489 options.no_presubmit = True | |
490 options.no_network = True | 488 options.no_network = True |
491 if options.download_data_only: | |
492 options.no_presubmit = True | |
493 if options.command_prefix: | 489 if options.command_prefix: |
494 print("Specifying --command-prefix disables network distribution, " | 490 print("Specifying --command-prefix disables network distribution, " |
495 "running tests locally.") | 491 "running tests locally.") |
496 options.no_network = True | 492 options.no_network = True |
497 options.command_prefix = shlex.split(options.command_prefix) | 493 options.command_prefix = shlex.split(options.command_prefix) |
498 options.extra_flags = shlex.split(options.extra_flags) | 494 options.extra_flags = shlex.split(options.extra_flags) |
499 | 495 |
500 if options.gc_stress: | 496 if options.gc_stress: |
501 options.extra_flags += GC_STRESS_FLAGS | 497 options.extra_flags += GC_STRESS_FLAGS |
502 | 498 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 parser.print_help() | 620 parser.print_help() |
625 return 1 | 621 return 1 |
626 SetupEnvironment(options) | 622 SetupEnvironment(options) |
627 | 623 |
628 if options.swarming: | 624 if options.swarming: |
629 # Swarming doesn't print how isolated commands are called. Lets make this | 625 # Swarming doesn't print how isolated commands are called. Lets make this |
630 # less cryptic by printing it ourselves. | 626 # less cryptic by printing it ourselves. |
631 print ' '.join(sys.argv) | 627 print ' '.join(sys.argv) |
632 | 628 |
633 exit_code = 0 | 629 exit_code = 0 |
634 if not options.no_presubmit: | |
635 print ">>> running presubmit tests" | |
636 exit_code = subprocess.call( | |
637 [sys.executable, join(BASE_DIR, "tools", "presubmit.py")]) | |
638 | 630 |
639 suite_paths = utils.GetSuitePaths(join(BASE_DIR, "test")) | 631 suite_paths = utils.GetSuitePaths(join(BASE_DIR, "test")) |
640 | 632 |
641 # Use default tests if no test configuration was provided at the cmd line. | 633 # Use default tests if no test configuration was provided at the cmd line. |
642 if len(args) == 0: | 634 if len(args) == 0: |
643 args = ["default"] | 635 args = ["default"] |
644 | 636 |
645 # Expand arguments with grouped tests. The args should reflect the list of | 637 # Expand arguments with grouped tests. The args should reflect the list of |
646 # suites as otherwise filters would break. | 638 # suites as otherwise filters would break. |
647 def ExpandTestGroups(name): | 639 def ExpandTestGroups(name): |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 "--coverage-dir=%s" % options.sancov_dir]) | 869 "--coverage-dir=%s" % options.sancov_dir]) |
878 except: | 870 except: |
879 print >> sys.stderr, "Error: Merging sancov files failed." | 871 print >> sys.stderr, "Error: Merging sancov files failed." |
880 exit_code = 1 | 872 exit_code = 1 |
881 | 873 |
882 return exit_code | 874 return exit_code |
883 | 875 |
884 | 876 |
885 if __name__ == "__main__": | 877 if __name__ == "__main__": |
886 sys.exit(Main()) | 878 sys.exit(Main()) |
OLD | NEW |