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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 help="Adapt to path structure used on buildbots", | 219 help="Adapt to path structure used on buildbots", |
220 default=False, action="store_true") | 220 default=False, action="store_true") |
221 result.add_option("--dcheck-always-on", | 221 result.add_option("--dcheck-always-on", |
222 help="Indicates that V8 was compiled with DCHECKs enabled", | 222 help="Indicates that V8 was compiled with DCHECKs enabled", |
223 default=False, action="store_true") | 223 default=False, action="store_true") |
224 result.add_option("--novfp3", | 224 result.add_option("--novfp3", |
225 help="Indicates that V8 was compiled without VFP3 support", | 225 help="Indicates that V8 was compiled without VFP3 support", |
226 default=False, action="store_true") | 226 default=False, action="store_true") |
227 result.add_option("--cat", help="Print the source of the tests", | 227 result.add_option("--cat", help="Print the source of the tests", |
228 default=False, action="store_true") | 228 default=False, action="store_true") |
229 result.add_option("--flaky-tests", | |
230 help="Regard tests marked as flaky (run|skip|dontcare)", | |
231 default="dontcare") | |
232 result.add_option("--slow-tests", | 229 result.add_option("--slow-tests", |
233 help="Regard slow tests (run|skip|dontcare)", | 230 help="Regard slow tests (run|skip|dontcare)", |
234 default="dontcare") | 231 default="dontcare") |
235 result.add_option("--pass-fail-tests", | 232 result.add_option("--pass-fail-tests", |
236 help="Regard pass|fail tests (run|skip|dontcare)", | 233 help="Regard pass|fail tests (run|skip|dontcare)", |
237 default="dontcare") | 234 default="dontcare") |
238 result.add_option("--gc-stress", | 235 result.add_option("--gc-stress", |
239 help="Switch on GC stress mode", | 236 help="Switch on GC stress mode", |
240 default=False, action="store_true") | 237 default=False, action="store_true") |
241 result.add_option("--gcov-coverage", | 238 result.add_option("--gcov-coverage", |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 result.add_option("--outdir", help="Base directory with compile output", | 292 result.add_option("--outdir", help="Base directory with compile output", |
296 default="out") | 293 default="out") |
297 result.add_option("--predictable", | 294 result.add_option("--predictable", |
298 help="Compare output of several reruns of each test", | 295 help="Compare output of several reruns of each test", |
299 default=False, action="store_true") | 296 default=False, action="store_true") |
300 result.add_option("-p", "--progress", | 297 result.add_option("-p", "--progress", |
301 help=("The style of progress indicator" | 298 help=("The style of progress indicator" |
302 " (verbose, dots, color, mono)"), | 299 " (verbose, dots, color, mono)"), |
303 choices=progress.PROGRESS_INDICATORS.keys(), default="mono") | 300 choices=progress.PROGRESS_INDICATORS.keys(), default="mono") |
304 result.add_option("--quickcheck", default=False, action="store_true", | 301 result.add_option("--quickcheck", default=False, action="store_true", |
305 help=("Quick check mode (skip slow/flaky tests)")) | 302 help=("Quick check mode (skip slow tests)")) |
306 result.add_option("--report", help="Print a summary of the tests to be run", | 303 result.add_option("--report", help="Print a summary of the tests to be run", |
307 default=False, action="store_true") | 304 default=False, action="store_true") |
308 result.add_option("--json-test-results", | 305 result.add_option("--json-test-results", |
309 help="Path to a file for storing json results.") | 306 help="Path to a file for storing json results.") |
310 result.add_option("--rerun-failures-count", | 307 result.add_option("--rerun-failures-count", |
311 help=("Number of times to rerun each failing test case. " | 308 help=("Number of times to rerun each failing test case. " |
312 "Very slow tests will be rerun only once."), | 309 "Very slow tests will be rerun only once."), |
313 default=0, type="int") | 310 default=0, type="int") |
314 result.add_option("--rerun-failures-max", | 311 result.add_option("--rerun-failures-max", |
315 help="Maximum number of failing test cases to rerun.", | 312 help="Maximum number of failing test cases to rerun.", |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 """Returns true if zero or one of multiple arguments are true.""" | 492 """Returns true if zero or one of multiple arguments are true.""" |
496 return reduce(lambda x, y: x + y, args) <= 1 | 493 return reduce(lambda x, y: x + y, args) <= 1 |
497 | 494 |
498 if not excl(options.no_stress, options.stress_only, options.no_variants, | 495 if not excl(options.no_stress, options.stress_only, options.no_variants, |
499 bool(options.variants)): | 496 bool(options.variants)): |
500 print("Use only one of --no-stress, --stress-only, --no-variants, " | 497 print("Use only one of --no-stress, --stress-only, --no-variants, " |
501 "or --variants.") | 498 "or --variants.") |
502 return False | 499 return False |
503 if options.quickcheck: | 500 if options.quickcheck: |
504 VARIANTS = ["default", "stress"] | 501 VARIANTS = ["default", "stress"] |
505 options.flaky_tests = "skip" | |
506 options.slow_tests = "skip" | 502 options.slow_tests = "skip" |
507 options.pass_fail_tests = "skip" | 503 options.pass_fail_tests = "skip" |
508 if options.no_stress: | 504 if options.no_stress: |
509 VARIANTS = ["default", "nocrankshaft"] | 505 VARIANTS = ["default", "nocrankshaft"] |
510 if options.no_variants: | 506 if options.no_variants: |
511 VARIANTS = ["default"] | 507 VARIANTS = ["default"] |
512 if options.stress_only: | 508 if options.stress_only: |
513 VARIANTS = ["stress"] | 509 VARIANTS = ["stress"] |
514 if options.variants: | 510 if options.variants: |
515 VARIANTS = options.variants.split(",") | 511 VARIANTS = options.variants.split(",") |
(...skipping 13 matching lines...) Expand all Loading... |
529 if options.valgrind: | 525 if options.valgrind: |
530 run_valgrind = os.path.join("tools", "run-valgrind.py") | 526 run_valgrind = os.path.join("tools", "run-valgrind.py") |
531 # This is OK for distributed running, so we don't need to set no_network. | 527 # This is OK for distributed running, so we don't need to set no_network. |
532 options.command_prefix = (["python", "-u", run_valgrind] + | 528 options.command_prefix = (["python", "-u", run_valgrind] + |
533 options.command_prefix) | 529 options.command_prefix) |
534 def CheckTestMode(name, option): | 530 def CheckTestMode(name, option): |
535 if not option in ["run", "skip", "dontcare"]: | 531 if not option in ["run", "skip", "dontcare"]: |
536 print "Unknown %s mode %s" % (name, option) | 532 print "Unknown %s mode %s" % (name, option) |
537 return False | 533 return False |
538 return True | 534 return True |
539 if not CheckTestMode("flaky test", options.flaky_tests): | |
540 return False | |
541 if not CheckTestMode("slow test", options.slow_tests): | 535 if not CheckTestMode("slow test", options.slow_tests): |
542 return False | 536 return False |
543 if not CheckTestMode("pass|fail test", options.pass_fail_tests): | 537 if not CheckTestMode("pass|fail test", options.pass_fail_tests): |
544 return False | 538 return False |
545 if options.no_i18n: | 539 if options.no_i18n: |
546 TEST_MAP["bot_default"].remove("intl") | 540 TEST_MAP["bot_default"].remove("intl") |
547 TEST_MAP["default"].remove("intl") | 541 TEST_MAP["default"].remove("intl") |
548 return True | 542 return True |
549 | 543 |
550 | 544 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 "byteorder": sys.byteorder, | 724 "byteorder": sys.byteorder, |
731 } | 725 } |
732 all_tests = [] | 726 all_tests = [] |
733 num_tests = 0 | 727 num_tests = 0 |
734 for s in suites: | 728 for s in suites: |
735 s.ReadStatusFile(variables) | 729 s.ReadStatusFile(variables) |
736 s.ReadTestCases(ctx) | 730 s.ReadTestCases(ctx) |
737 if len(args) > 0: | 731 if len(args) > 0: |
738 s.FilterTestCasesByArgs(args) | 732 s.FilterTestCasesByArgs(args) |
739 all_tests += s.tests | 733 all_tests += s.tests |
740 s.FilterTestCasesByStatus(options.warn_unused, options.flaky_tests, | 734 s.FilterTestCasesByStatus(options.warn_unused, options.slow_tests, |
741 options.slow_tests, options.pass_fail_tests) | 735 options.pass_fail_tests) |
742 if options.cat: | 736 if options.cat: |
743 verbose.PrintTestSource(s.tests) | 737 verbose.PrintTestSource(s.tests) |
744 continue | 738 continue |
745 variant_gen = s.CreateVariantGenerator(VARIANTS) | 739 variant_gen = s.CreateVariantGenerator(VARIANTS) |
746 variant_tests = [ t.CopyAddingFlags(v, flags) | 740 variant_tests = [ t.CopyAddingFlags(v, flags) |
747 for t in s.tests | 741 for t in s.tests |
748 for v in variant_gen.FilterVariantsByTest(t) | 742 for v in variant_gen.FilterVariantsByTest(t) |
749 for flags in variant_gen.GetFlagSets(t, v) ] | 743 for flags in variant_gen.GetFlagSets(t, v) ] |
750 | 744 |
751 if options.random_seed_stress_count > 1: | 745 if options.random_seed_stress_count > 1: |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 "--coverage-dir=%s" % options.sancov_dir]) | 831 "--coverage-dir=%s" % options.sancov_dir]) |
838 except: | 832 except: |
839 print >> sys.stderr, "Error: Merging sancov files failed." | 833 print >> sys.stderr, "Error: Merging sancov files failed." |
840 exit_code = 1 | 834 exit_code = 1 |
841 | 835 |
842 return exit_code | 836 return exit_code |
843 | 837 |
844 | 838 |
845 if __name__ == "__main__": | 839 if __name__ == "__main__": |
846 sys.exit(Main()) | 840 sys.exit(Main()) |
OLD | NEW |