| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 VARIANTS = ["default", "stress", "nocrankshaft"] | 62 VARIANTS = ["default", "stress", "nocrankshaft"] |
| 63 | 63 |
| 64 MODE_FLAGS = { | 64 MODE_FLAGS = { |
| 65 "debug" : ["--nobreak-on-abort", "--nodead-code-elimination", | 65 "debug" : ["--nobreak-on-abort", "--nodead-code-elimination", |
| 66 "--nofold-constants", "--enable-slow-asserts", | 66 "--nofold-constants", "--enable-slow-asserts", |
| 67 "--debug-code", "--verify-heap"], | 67 "--debug-code", "--verify-heap"], |
| 68 "release" : ["--nobreak-on-abort", "--nodead-code-elimination", | 68 "release" : ["--nobreak-on-abort", "--nodead-code-elimination", |
| 69 "--nofold-constants"]} | 69 "--nofold-constants"]} |
| 70 | 70 |
| 71 GC_STRESS_FLAGS = ["--gc-interval=500", "--stress-compaction", |
| 72 "--concurrent-recompilation-queue-length=64", |
| 73 "--concurrent-recompilation-delay=500", |
| 74 "--concurrent-recompilation"] |
| 75 |
| 71 SUPPORTED_ARCHS = ["android_arm", | 76 SUPPORTED_ARCHS = ["android_arm", |
| 72 "android_ia32", | 77 "android_ia32", |
| 73 "arm", | 78 "arm", |
| 74 "ia32", | 79 "ia32", |
| 75 "mipsel", | 80 "mipsel", |
| 76 "nacl_ia32", | 81 "nacl_ia32", |
| 77 "nacl_x64", | 82 "nacl_x64", |
| 78 "x64", | 83 "x64", |
| 79 "a64"] | 84 "a64"] |
| 80 # Double the timeout for these: | 85 # Double the timeout for these: |
| (...skipping 22 matching lines...) Expand all Loading... |
| 103 default=False, action="store_true") | 108 default=False, action="store_true") |
| 104 result.add_option("--flaky-tests", | 109 result.add_option("--flaky-tests", |
| 105 help="Regard tests marked as flaky (run|skip|dontcare)", | 110 help="Regard tests marked as flaky (run|skip|dontcare)", |
| 106 default="dontcare") | 111 default="dontcare") |
| 107 result.add_option("--slow-tests", | 112 result.add_option("--slow-tests", |
| 108 help="Regard slow tests (run|skip|dontcare)", | 113 help="Regard slow tests (run|skip|dontcare)", |
| 109 default="dontcare") | 114 default="dontcare") |
| 110 result.add_option("--pass-fail-tests", | 115 result.add_option("--pass-fail-tests", |
| 111 help="Regard pass|fail tests (run|skip|dontcare)", | 116 help="Regard pass|fail tests (run|skip|dontcare)", |
| 112 default="dontcare") | 117 default="dontcare") |
| 118 result.add_option("--gc-stress", |
| 119 help="Switch on GC stress mode", |
| 120 default=False, action="store_true") |
| 113 result.add_option("--command-prefix", | 121 result.add_option("--command-prefix", |
| 114 help="Prepended to each shell command used to run a test", | 122 help="Prepended to each shell command used to run a test", |
| 115 default="") | 123 default="") |
| 116 result.add_option("--download-data", help="Download missing test suite data", | 124 result.add_option("--download-data", help="Download missing test suite data", |
| 117 default=False, action="store_true") | 125 default=False, action="store_true") |
| 118 result.add_option("--extra-flags", | 126 result.add_option("--extra-flags", |
| 119 help="Additional flags to pass to each test command", | 127 help="Additional flags to pass to each test command", |
| 120 default="") | 128 default="") |
| 121 result.add_option("--isolates", help="Whether to test isolates", | 129 result.add_option("--isolates", help="Whether to test isolates", |
| 122 default=False, action="store_true") | 130 default=False, action="store_true") |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 if options.buildbot: | 227 if options.buildbot: |
| 220 # Buildbots run presubmit tests as a separate step. | 228 # Buildbots run presubmit tests as a separate step. |
| 221 options.no_presubmit = True | 229 options.no_presubmit = True |
| 222 options.no_network = True | 230 options.no_network = True |
| 223 if options.command_prefix: | 231 if options.command_prefix: |
| 224 print("Specifying --command-prefix disables network distribution, " | 232 print("Specifying --command-prefix disables network distribution, " |
| 225 "running tests locally.") | 233 "running tests locally.") |
| 226 options.no_network = True | 234 options.no_network = True |
| 227 options.command_prefix = shlex.split(options.command_prefix) | 235 options.command_prefix = shlex.split(options.command_prefix) |
| 228 options.extra_flags = shlex.split(options.extra_flags) | 236 options.extra_flags = shlex.split(options.extra_flags) |
| 237 |
| 238 if options.gc_stress: |
| 239 options.extra_flags += GC_STRESS_FLAGS |
| 240 |
| 229 if options.j == 0: | 241 if options.j == 0: |
| 230 options.j = multiprocessing.cpu_count() | 242 options.j = multiprocessing.cpu_count() |
| 231 | 243 |
| 232 def excl(*args): | 244 def excl(*args): |
| 233 """Returns true if zero or one of multiple arguments are true.""" | 245 """Returns true if zero or one of multiple arguments are true.""" |
| 234 return reduce(lambda x, y: x + y, args) <= 1 | 246 return reduce(lambda x, y: x + y, args) <= 1 |
| 235 | 247 |
| 236 if not excl(options.no_stress, options.stress_only, options.no_variants, | 248 if not excl(options.no_stress, options.stress_only, options.no_variants, |
| 237 bool(options.variants), options.quickcheck): | 249 bool(options.variants), options.quickcheck): |
| 238 print("Use only one of --no-stress, --stress-only, --no-variants, " | 250 print("Use only one of --no-stress, --stress-only, --no-variants, " |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 mode_flags, options.verbose, | 386 mode_flags, options.verbose, |
| 375 timeout, options.isolates, | 387 timeout, options.isolates, |
| 376 options.command_prefix, | 388 options.command_prefix, |
| 377 options.extra_flags, | 389 options.extra_flags, |
| 378 options.no_i18n) | 390 options.no_i18n) |
| 379 | 391 |
| 380 simulator_run = not options.dont_skip_simulator_slow_tests and \ | 392 simulator_run = not options.dont_skip_simulator_slow_tests and \ |
| 381 arch in ['a64', 'arm', 'mips'] and ARCH_GUESS and arch != ARCH_GUESS | 393 arch in ['a64', 'arm', 'mips'] and ARCH_GUESS and arch != ARCH_GUESS |
| 382 # Find available test suites and read test cases from them. | 394 # Find available test suites and read test cases from them. |
| 383 variables = { | 395 variables = { |
| 396 "arch": arch, |
| 397 "deopt_fuzzer": False, |
| 398 "gc_stress": options.gc_stress, |
| 399 "isolates": options.isolates, |
| 384 "mode": mode, | 400 "mode": mode, |
| 385 "arch": arch, | 401 "no_i18n": options.no_i18n, |
| 402 "simulator_run": simulator_run, |
| 386 "system": utils.GuessOS(), | 403 "system": utils.GuessOS(), |
| 387 "isolates": options.isolates, | |
| 388 "simulator_run": simulator_run, | |
| 389 "deopt_fuzzer": False, | |
| 390 "no_i18n": options.no_i18n, | |
| 391 } | 404 } |
| 392 all_tests = [] | 405 all_tests = [] |
| 393 num_tests = 0 | 406 num_tests = 0 |
| 394 test_id = 0 | 407 test_id = 0 |
| 395 for s in suites: | 408 for s in suites: |
| 396 s.ReadStatusFile(variables) | 409 s.ReadStatusFile(variables) |
| 397 s.ReadTestCases(ctx) | 410 s.ReadTestCases(ctx) |
| 398 if len(args) > 0: | 411 if len(args) > 0: |
| 399 s.FilterTestCasesByArgs(args) | 412 s.FilterTestCasesByArgs(args) |
| 400 all_tests += s.tests | 413 all_tests += s.tests |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 except KeyboardInterrupt: | 476 except KeyboardInterrupt: |
| 464 raise | 477 raise |
| 465 | 478 |
| 466 if options.time: | 479 if options.time: |
| 467 verbose.PrintTestDurations(suites, overall_duration) | 480 verbose.PrintTestDurations(suites, overall_duration) |
| 468 return exit_code | 481 return exit_code |
| 469 | 482 |
| 470 | 483 |
| 471 if __name__ == "__main__": | 484 if __name__ == "__main__": |
| 472 sys.exit(Main()) | 485 sys.exit(Main()) |
| OLD | NEW |