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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 result.add_option("--no-stress", "--nostress", | 164 result.add_option("--no-stress", "--nostress", |
165 help="Don't run crankshaft --always-opt --stress-op test", | 165 help="Don't run crankshaft --always-opt --stress-op test", |
166 default=False, dest="no_stress", action="store_true") | 166 default=False, dest="no_stress", action="store_true") |
167 result.add_option("--no-variants", "--novariants", | 167 result.add_option("--no-variants", "--novariants", |
168 help="Don't run any testing variants", | 168 help="Don't run any testing variants", |
169 default=False, dest="no_variants", action="store_true") | 169 default=False, dest="no_variants", action="store_true") |
170 result.add_option("--variants", | 170 result.add_option("--variants", |
171 help="Comma-separated list of testing variants") | 171 help="Comma-separated list of testing variants") |
172 result.add_option("--outdir", help="Base directory with compile output", | 172 result.add_option("--outdir", help="Base directory with compile output", |
173 default="out") | 173 default="out") |
| 174 result.add_option("--predictable", |
| 175 help="Compare output of several reruns of each test", |
| 176 default=False, action="store_true") |
174 result.add_option("-p", "--progress", | 177 result.add_option("-p", "--progress", |
175 help=("The style of progress indicator" | 178 help=("The style of progress indicator" |
176 " (verbose, dots, color, mono)"), | 179 " (verbose, dots, color, mono)"), |
177 choices=progress.PROGRESS_INDICATORS.keys(), default="mono") | 180 choices=progress.PROGRESS_INDICATORS.keys(), default="mono") |
178 result.add_option("--quickcheck", default=False, action="store_true", | 181 result.add_option("--quickcheck", default=False, action="store_true", |
179 help=("Quick check mode (skip slow/flaky tests)")) | 182 help=("Quick check mode (skip slow/flaky tests)")) |
180 result.add_option("--report", help="Print a summary of the tests to be run", | 183 result.add_option("--report", help="Print a summary of the tests to be run", |
181 default=False, action="store_true") | 184 default=False, action="store_true") |
182 result.add_option("--json-test-results", | 185 result.add_option("--json-test-results", |
183 help="Path to a file for storing json results.") | 186 help="Path to a file for storing json results.") |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 if options.variants: | 297 if options.variants: |
295 VARIANTS = options.variants.split(",") | 298 VARIANTS = options.variants.split(",") |
296 if not set(VARIANTS).issubset(VARIANT_FLAGS.keys()): | 299 if not set(VARIANTS).issubset(VARIANT_FLAGS.keys()): |
297 print "All variants must be in %s" % str(VARIANT_FLAGS.keys()) | 300 print "All variants must be in %s" % str(VARIANT_FLAGS.keys()) |
298 return False | 301 return False |
299 if options.quickcheck: | 302 if options.quickcheck: |
300 VARIANTS = ["default", "stress"] | 303 VARIANTS = ["default", "stress"] |
301 options.flaky_tests = "skip" | 304 options.flaky_tests = "skip" |
302 options.slow_tests = "skip" | 305 options.slow_tests = "skip" |
303 options.pass_fail_tests = "skip" | 306 options.pass_fail_tests = "skip" |
| 307 if options.predictable: |
| 308 VARIANTS = ["default"] |
| 309 options.extra_flags.append("--predictable") |
| 310 options.extra_flags.append("--verify_predictable") |
| 311 options.extra_flags.append("--no-inline-new") |
304 | 312 |
305 if not options.shell_dir: | 313 if not options.shell_dir: |
306 if options.shell: | 314 if options.shell: |
307 print "Warning: --shell is deprecated, use --shell-dir instead." | 315 print "Warning: --shell is deprecated, use --shell-dir instead." |
308 options.shell_dir = os.path.dirname(options.shell) | 316 options.shell_dir = os.path.dirname(options.shell) |
309 if options.valgrind: | 317 if options.valgrind: |
310 run_valgrind = os.path.join("tools", "run-valgrind.py") | 318 run_valgrind = os.path.join("tools", "run-valgrind.py") |
311 # This is OK for distributed running, so we don't need to set no_network. | 319 # This is OK for distributed running, so we don't need to set no_network. |
312 options.command_prefix = (["python", "-u", run_valgrind] + | 320 options.command_prefix = (["python", "-u", run_valgrind] + |
313 options.command_prefix) | 321 options.command_prefix) |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 mode_flags = MODE_FLAGS[mode] | 417 mode_flags = MODE_FLAGS[mode] |
410 timeout = options.timeout | 418 timeout = options.timeout |
411 if timeout == -1: | 419 if timeout == -1: |
412 # Simulators are slow, therefore allow a longer default timeout. | 420 # Simulators are slow, therefore allow a longer default timeout. |
413 if arch in SLOW_ARCHS: | 421 if arch in SLOW_ARCHS: |
414 timeout = 2 * TIMEOUT_DEFAULT; | 422 timeout = 2 * TIMEOUT_DEFAULT; |
415 else: | 423 else: |
416 timeout = TIMEOUT_DEFAULT; | 424 timeout = TIMEOUT_DEFAULT; |
417 | 425 |
418 timeout *= TIMEOUT_SCALEFACTOR[mode] | 426 timeout *= TIMEOUT_SCALEFACTOR[mode] |
| 427 |
| 428 if options.predictable: |
| 429 # Predictable mode is slower. |
| 430 timeout *= 2 |
| 431 |
419 ctx = context.Context(arch, mode, shell_dir, | 432 ctx = context.Context(arch, mode, shell_dir, |
420 mode_flags, options.verbose, | 433 mode_flags, options.verbose, |
421 timeout, options.isolates, | 434 timeout, options.isolates, |
422 options.command_prefix, | 435 options.command_prefix, |
423 options.extra_flags, | 436 options.extra_flags, |
424 options.no_i18n, | 437 options.no_i18n, |
425 options.random_seed, | 438 options.random_seed, |
426 options.no_sorting, | 439 options.no_sorting, |
427 options.rerun_failures_count, | 440 options.rerun_failures_count, |
428 options.rerun_failures_max) | 441 options.rerun_failures_max, |
| 442 options.predictable) |
429 | 443 |
430 # TODO(all): Combine "simulator" and "simulator_run". | 444 # TODO(all): Combine "simulator" and "simulator_run". |
431 simulator_run = not options.dont_skip_simulator_slow_tests and \ | 445 simulator_run = not options.dont_skip_simulator_slow_tests and \ |
432 arch in ['arm64', 'arm', 'mips'] and ARCH_GUESS and arch != ARCH_GUESS | 446 arch in ['arm64', 'arm', 'mips'] and ARCH_GUESS and arch != ARCH_GUESS |
433 # Find available test suites and read test cases from them. | 447 # Find available test suites and read test cases from them. |
434 variables = { | 448 variables = { |
435 "arch": arch, | 449 "arch": arch, |
436 "asan": options.asan, | 450 "asan": options.asan, |
437 "deopt_fuzzer": False, | 451 "deopt_fuzzer": False, |
438 "gc_stress": options.gc_stress, | 452 "gc_stress": options.gc_stress, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 exit_code = runner.Run(options.j) | 530 exit_code = runner.Run(options.j) |
517 overall_duration = time.time() - start_time | 531 overall_duration = time.time() - start_time |
518 | 532 |
519 if options.time: | 533 if options.time: |
520 verbose.PrintTestDurations(suites, overall_duration) | 534 verbose.PrintTestDurations(suites, overall_duration) |
521 return exit_code | 535 return exit_code |
522 | 536 |
523 | 537 |
524 if __name__ == "__main__": | 538 if __name__ == "__main__": |
525 sys.exit(Main()) | 539 sys.exit(Main()) |
OLD | NEW |