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") | |
Igor Sheludko
2014/07/08 13:15:20
Add --no-inline-new to make the synthetic "time" i
| |
304 | 311 |
305 if not options.shell_dir: | 312 if not options.shell_dir: |
306 if options.shell: | 313 if options.shell: |
307 print "Warning: --shell is deprecated, use --shell-dir instead." | 314 print "Warning: --shell is deprecated, use --shell-dir instead." |
308 options.shell_dir = os.path.dirname(options.shell) | 315 options.shell_dir = os.path.dirname(options.shell) |
309 if options.valgrind: | 316 if options.valgrind: |
310 run_valgrind = os.path.join("tools", "run-valgrind.py") | 317 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. | 318 # This is OK for distributed running, so we don't need to set no_network. |
312 options.command_prefix = (["python", "-u", run_valgrind] + | 319 options.command_prefix = (["python", "-u", run_valgrind] + |
313 options.command_prefix) | 320 options.command_prefix) |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
409 mode_flags = MODE_FLAGS[mode] | 416 mode_flags = MODE_FLAGS[mode] |
410 timeout = options.timeout | 417 timeout = options.timeout |
411 if timeout == -1: | 418 if timeout == -1: |
412 # Simulators are slow, therefore allow a longer default timeout. | 419 # Simulators are slow, therefore allow a longer default timeout. |
413 if arch in SLOW_ARCHS: | 420 if arch in SLOW_ARCHS: |
414 timeout = 2 * TIMEOUT_DEFAULT; | 421 timeout = 2 * TIMEOUT_DEFAULT; |
415 else: | 422 else: |
416 timeout = TIMEOUT_DEFAULT; | 423 timeout = TIMEOUT_DEFAULT; |
417 | 424 |
418 timeout *= TIMEOUT_SCALEFACTOR[mode] | 425 timeout *= TIMEOUT_SCALEFACTOR[mode] |
426 | |
427 if options.predictable: | |
428 # Predictable mode is slower. | |
429 timeout *= 2 | |
430 | |
419 ctx = context.Context(arch, mode, shell_dir, | 431 ctx = context.Context(arch, mode, shell_dir, |
420 mode_flags, options.verbose, | 432 mode_flags, options.verbose, |
421 timeout, options.isolates, | 433 timeout, options.isolates, |
422 options.command_prefix, | 434 options.command_prefix, |
423 options.extra_flags, | 435 options.extra_flags, |
424 options.no_i18n, | 436 options.no_i18n, |
425 options.random_seed, | 437 options.random_seed, |
426 options.no_sorting, | 438 options.no_sorting, |
427 options.rerun_failures_count, | 439 options.rerun_failures_count, |
428 options.rerun_failures_max) | 440 options.rerun_failures_max, |
441 options.predictable) | |
429 | 442 |
430 # TODO(all): Combine "simulator" and "simulator_run". | 443 # TODO(all): Combine "simulator" and "simulator_run". |
431 simulator_run = not options.dont_skip_simulator_slow_tests and \ | 444 simulator_run = not options.dont_skip_simulator_slow_tests and \ |
432 arch in ['arm64', 'arm', 'mips'] and ARCH_GUESS and arch != ARCH_GUESS | 445 arch in ['arm64', 'arm', 'mips'] and ARCH_GUESS and arch != ARCH_GUESS |
433 # Find available test suites and read test cases from them. | 446 # Find available test suites and read test cases from them. |
434 variables = { | 447 variables = { |
435 "arch": arch, | 448 "arch": arch, |
436 "asan": options.asan, | 449 "asan": options.asan, |
437 "deopt_fuzzer": False, | 450 "deopt_fuzzer": False, |
438 "gc_stress": options.gc_stress, | 451 "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) | 529 exit_code = runner.Run(options.j) |
517 overall_duration = time.time() - start_time | 530 overall_duration = time.time() - start_time |
518 | 531 |
519 if options.time: | 532 if options.time: |
520 verbose.PrintTestDurations(suites, overall_duration) | 533 verbose.PrintTestDurations(suites, overall_duration) |
521 return exit_code | 534 return exit_code |
522 | 535 |
523 | 536 |
524 if __name__ == "__main__": | 537 if __name__ == "__main__": |
525 sys.exit(Main()) | 538 sys.exit(Main()) |
OLD | NEW |