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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 help="Don't skip more slow tests when using a simulator.", | 206 help="Don't skip more slow tests when using a simulator.", |
207 default=False, action="store_true", | 207 default=False, action="store_true", |
208 dest="dont_skip_simulator_slow_tests") | 208 dest="dont_skip_simulator_slow_tests") |
209 result.add_option("--stress-only", | 209 result.add_option("--stress-only", |
210 help="Only run tests with --always-opt --stress-opt", | 210 help="Only run tests with --always-opt --stress-opt", |
211 default=False, action="store_true") | 211 default=False, action="store_true") |
212 result.add_option("--time", help="Print timing information after running", | 212 result.add_option("--time", help="Print timing information after running", |
213 default=False, action="store_true") | 213 default=False, action="store_true") |
214 result.add_option("-t", "--timeout", help="Timeout in seconds", | 214 result.add_option("-t", "--timeout", help="Timeout in seconds", |
215 default= -1, type="int") | 215 default= -1, type="int") |
| 216 result.add_option("--tsan", |
| 217 help="Regard test expectations for TSAN", |
| 218 default=False, action="store_true") |
216 result.add_option("-v", "--verbose", help="Verbose output", | 219 result.add_option("-v", "--verbose", help="Verbose output", |
217 default=False, action="store_true") | 220 default=False, action="store_true") |
218 result.add_option("--valgrind", help="Run tests through valgrind", | 221 result.add_option("--valgrind", help="Run tests through valgrind", |
219 default=False, action="store_true") | 222 default=False, action="store_true") |
220 result.add_option("--warn-unused", help="Report unused rules", | 223 result.add_option("--warn-unused", help="Report unused rules", |
221 default=False, action="store_true") | 224 default=False, action="store_true") |
222 result.add_option("--junitout", help="File name of the JUnit output") | 225 result.add_option("--junitout", help="File name of the JUnit output") |
223 result.add_option("--junittestsuite", | 226 result.add_option("--junittestsuite", |
224 help="The testsuite name in the JUnit output file", | 227 help="The testsuite name in the JUnit output file", |
225 default="v8tests") | 228 default="v8tests") |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 options.no_network = True | 271 options.no_network = True |
269 options.command_prefix = shlex.split(options.command_prefix) | 272 options.command_prefix = shlex.split(options.command_prefix) |
270 options.extra_flags = shlex.split(options.extra_flags) | 273 options.extra_flags = shlex.split(options.extra_flags) |
271 | 274 |
272 if options.gc_stress: | 275 if options.gc_stress: |
273 options.extra_flags += GC_STRESS_FLAGS | 276 options.extra_flags += GC_STRESS_FLAGS |
274 | 277 |
275 if options.asan: | 278 if options.asan: |
276 options.extra_flags.append("--invoke-weak-callbacks") | 279 options.extra_flags.append("--invoke-weak-callbacks") |
277 | 280 |
| 281 if options.tsan: |
| 282 VARIANTS = ["default"] |
| 283 |
278 if options.j == 0: | 284 if options.j == 0: |
279 options.j = multiprocessing.cpu_count() | 285 options.j = multiprocessing.cpu_count() |
280 | 286 |
281 while options.random_seed == 0: | 287 while options.random_seed == 0: |
282 options.random_seed = random.SystemRandom().randint(-2147483648, 2147483647) | 288 options.random_seed = random.SystemRandom().randint(-2147483648, 2147483647) |
283 | 289 |
284 def excl(*args): | 290 def excl(*args): |
285 """Returns true if zero or one of multiple arguments are true.""" | 291 """Returns true if zero or one of multiple arguments are true.""" |
286 return reduce(lambda x, y: x + y, args) <= 1 | 292 return reduce(lambda x, y: x + y, args) <= 1 |
287 | 293 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 "asan": options.asan, | 458 "asan": options.asan, |
453 "deopt_fuzzer": False, | 459 "deopt_fuzzer": False, |
454 "gc_stress": options.gc_stress, | 460 "gc_stress": options.gc_stress, |
455 "isolates": options.isolates, | 461 "isolates": options.isolates, |
456 "mode": mode, | 462 "mode": mode, |
457 "no_i18n": options.no_i18n, | 463 "no_i18n": options.no_i18n, |
458 "no_snap": options.no_snap, | 464 "no_snap": options.no_snap, |
459 "simulator_run": simulator_run, | 465 "simulator_run": simulator_run, |
460 "simulator": utils.UseSimulator(arch), | 466 "simulator": utils.UseSimulator(arch), |
461 "system": utils.GuessOS(), | 467 "system": utils.GuessOS(), |
| 468 "tsan": options.tsan, |
462 } | 469 } |
463 all_tests = [] | 470 all_tests = [] |
464 num_tests = 0 | 471 num_tests = 0 |
465 test_id = 0 | 472 test_id = 0 |
466 for s in suites: | 473 for s in suites: |
467 s.ReadStatusFile(variables) | 474 s.ReadStatusFile(variables) |
468 s.ReadTestCases(ctx) | 475 s.ReadTestCases(ctx) |
469 if len(args) > 0: | 476 if len(args) > 0: |
470 s.FilterTestCasesByArgs(args) | 477 s.FilterTestCasesByArgs(args) |
471 all_tests += s.tests | 478 all_tests += s.tests |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 exit_code = runner.Run(options.j) | 539 exit_code = runner.Run(options.j) |
533 overall_duration = time.time() - start_time | 540 overall_duration = time.time() - start_time |
534 | 541 |
535 if options.time: | 542 if options.time: |
536 verbose.PrintTestDurations(suites, overall_duration) | 543 verbose.PrintTestDurations(suites, overall_duration) |
537 return exit_code | 544 return exit_code |
538 | 545 |
539 | 546 |
540 if __name__ == "__main__": | 547 if __name__ == "__main__": |
541 sys.exit(Main()) | 548 sys.exit(Main()) |
OLD | NEW |