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 15 matching lines...) Expand all Loading... |
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 | 29 |
30 | 30 |
31 import itertools | 31 import itertools |
32 import multiprocessing | 32 import multiprocessing |
33 import optparse | 33 import optparse |
34 import os | 34 import os |
35 from os.path import join | 35 from os.path import join |
| 36 import platform |
36 import shlex | 37 import shlex |
37 import subprocess | 38 import subprocess |
38 import sys | 39 import sys |
39 import time | 40 import time |
40 | 41 |
41 from testrunner.local import execution | 42 from testrunner.local import execution |
42 from testrunner.local import progress | 43 from testrunner.local import progress |
43 from testrunner.local import testsuite | 44 from testrunner.local import testsuite |
44 from testrunner.local import utils | 45 from testrunner.local import utils |
45 from testrunner.local import verbose | 46 from testrunner.local import verbose |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 95 |
95 def BuildOptions(): | 96 def BuildOptions(): |
96 result = optparse.OptionParser() | 97 result = optparse.OptionParser() |
97 result.add_option("--arch", | 98 result.add_option("--arch", |
98 help=("The architecture to run tests for, " | 99 help=("The architecture to run tests for, " |
99 "'auto' or 'native' for auto-detect"), | 100 "'auto' or 'native' for auto-detect"), |
100 default="ia32,x64,arm") | 101 default="ia32,x64,arm") |
101 result.add_option("--arch-and-mode", | 102 result.add_option("--arch-and-mode", |
102 help="Architecture and mode in the format 'arch.mode'", | 103 help="Architecture and mode in the format 'arch.mode'", |
103 default=None) | 104 default=None) |
| 105 result.add_option("--asan", |
| 106 help="Regard test expectations for ASAN", |
| 107 default=False, action="store_true") |
104 result.add_option("--buildbot", | 108 result.add_option("--buildbot", |
105 help="Adapt to path structure used on buildbots", | 109 help="Adapt to path structure used on buildbots", |
106 default=False, action="store_true") | 110 default=False, action="store_true") |
107 result.add_option("--cat", help="Print the source of the tests", | 111 result.add_option("--cat", help="Print the source of the tests", |
108 default=False, action="store_true") | 112 default=False, action="store_true") |
109 result.add_option("--flaky-tests", | 113 result.add_option("--flaky-tests", |
110 help="Regard tests marked as flaky (run|skip|dontcare)", | 114 help="Regard tests marked as flaky (run|skip|dontcare)", |
111 default="dontcare") | 115 default="dontcare") |
112 result.add_option("--slow-tests", | 116 result.add_option("--slow-tests", |
113 help="Regard slow tests (run|skip|dontcare)", | 117 help="Regard slow tests (run|skip|dontcare)", |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 timeout = TIMEOUT_DEFAULT; | 386 timeout = TIMEOUT_DEFAULT; |
383 | 387 |
384 timeout *= TIMEOUT_SCALEFACTOR[mode] | 388 timeout *= TIMEOUT_SCALEFACTOR[mode] |
385 ctx = context.Context(arch, mode, shell_dir, | 389 ctx = context.Context(arch, mode, shell_dir, |
386 mode_flags, options.verbose, | 390 mode_flags, options.verbose, |
387 timeout, options.isolates, | 391 timeout, options.isolates, |
388 options.command_prefix, | 392 options.command_prefix, |
389 options.extra_flags, | 393 options.extra_flags, |
390 options.no_i18n) | 394 options.no_i18n) |
391 | 395 |
| 396 # TODO(all): Combine "simulator" and "simulator_run". |
392 simulator_run = not options.dont_skip_simulator_slow_tests and \ | 397 simulator_run = not options.dont_skip_simulator_slow_tests and \ |
393 arch in ['a64', 'arm', 'mips'] and ARCH_GUESS and arch != ARCH_GUESS | 398 arch in ['a64', 'arm', 'mips'] and ARCH_GUESS and arch != ARCH_GUESS |
394 # Find available test suites and read test cases from them. | 399 # Find available test suites and read test cases from them. |
395 variables = { | 400 variables = { |
396 "arch": arch, | 401 "arch": arch, |
| 402 "asan": options.asan, |
397 "deopt_fuzzer": False, | 403 "deopt_fuzzer": False, |
398 "gc_stress": options.gc_stress, | 404 "gc_stress": options.gc_stress, |
399 "isolates": options.isolates, | 405 "isolates": options.isolates, |
400 "mode": mode, | 406 "mode": mode, |
401 "no_i18n": options.no_i18n, | 407 "no_i18n": options.no_i18n, |
402 "simulator_run": simulator_run, | 408 "simulator_run": simulator_run, |
| 409 "simulator": utils.UseSimulator(arch), |
403 "system": utils.GuessOS(), | 410 "system": utils.GuessOS(), |
404 } | 411 } |
405 all_tests = [] | 412 all_tests = [] |
406 num_tests = 0 | 413 num_tests = 0 |
407 test_id = 0 | 414 test_id = 0 |
408 for s in suites: | 415 for s in suites: |
409 s.ReadStatusFile(variables) | 416 s.ReadStatusFile(variables) |
410 s.ReadTestCases(ctx) | 417 s.ReadTestCases(ctx) |
411 if len(args) > 0: | 418 if len(args) > 0: |
412 s.FilterTestCasesByArgs(args) | 419 s.FilterTestCasesByArgs(args) |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 except KeyboardInterrupt: | 483 except KeyboardInterrupt: |
477 raise | 484 raise |
478 | 485 |
479 if options.time: | 486 if options.time: |
480 verbose.PrintTestDurations(suites, overall_duration) | 487 verbose.PrintTestDurations(suites, overall_duration) |
481 return exit_code | 488 return exit_code |
482 | 489 |
483 | 490 |
484 if __name__ == "__main__": | 491 if __name__ == "__main__": |
485 sys.exit(Main()) | 492 sys.exit(Main()) |
OLD | NEW |