Chromium Code Reviews| 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 12 matching lines...) Expand all Loading... | |
| 23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 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 from collections import OrderedDict | 31 from collections import OrderedDict |
| 32 import itertools | 32 import itertools |
| 33 import json | |
| 33 import multiprocessing | 34 import multiprocessing |
| 34 import optparse | 35 import optparse |
| 35 import os | 36 import os |
| 36 from os.path import join | 37 from os.path import join |
| 37 import platform | 38 import platform |
| 38 import random | 39 import random |
| 39 import shlex | 40 import shlex |
| 40 import subprocess | 41 import subprocess |
| 41 import sys | 42 import sys |
| 42 import time | 43 import time |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 427 'report_thread_leaks=0', | 428 'report_thread_leaks=0', |
| 428 'history_size=7', | 429 'history_size=7', |
| 429 'report_destroy_locked=0', | 430 'report_destroy_locked=0', |
| 430 ]) | 431 ]) |
| 431 | 432 |
| 432 def ProcessOptions(options): | 433 def ProcessOptions(options): |
| 433 global ALL_VARIANTS | 434 global ALL_VARIANTS |
| 434 global EXHAUSTIVE_VARIANTS | 435 global EXHAUSTIVE_VARIANTS |
| 435 global VARIANTS | 436 global VARIANTS |
| 436 | 437 |
| 438 # First try to auto-detect configurations based on the build if GN was | |
| 439 # used. This can't be overridden by cmd-line arguments. | |
|
vogelheim
2016/06/30 11:08:02
Clever. I really like this!
I still have somethin
Michael Achenbach
2016/06/30 11:47:49
Would be nice, unfortunately, the --list command s
vogelheim
2016/06/30 12:09:39
Pity. I had indeed misunderstood what --list does.
| |
| 440 options.auto_detect = False | |
| 441 build_config_path = os.path.join( | |
| 442 BASE_DIR, options.outdir, "v8_build_config.json") | |
| 443 if os.path.exists(build_config_path): | |
| 444 with open(build_config_path) as f: | |
| 445 build_config = json.load(f) | |
| 446 options.auto_detect = True | |
| 447 | |
| 448 options.arch_and_mode = None | |
| 449 options.arch = build_config["v8_target_cpu"] | |
| 450 if options.arch == 'x86': | |
| 451 # TODO(machenbach): Transform all to x86 eventually. | |
| 452 options.arch = 'ia32' | |
| 453 options.asan = build_config["is_asan"] | |
| 454 options.dcheck_always_on = build_config["dcheck_always_on"] | |
| 455 options.mode = 'debug' if build_config["is_debug"] else 'release' | |
| 456 options.msan = build_config["is_msan"] | |
| 457 options.no_i18n = not build_config["v8_enable_i18n_support"] | |
| 458 options.no_snap = not build_config["v8_use_snapshot"] | |
| 459 options.tsan = build_config["is_tsan"] | |
| 460 | |
| 437 # Architecture and mode related stuff. | 461 # Architecture and mode related stuff. |
| 438 if options.arch_and_mode: | 462 if options.arch_and_mode: |
| 439 options.arch_and_mode = [arch_and_mode.split(".") | 463 options.arch_and_mode = [arch_and_mode.split(".") |
| 440 for arch_and_mode in options.arch_and_mode.split(",")] | 464 for arch_and_mode in options.arch_and_mode.split(",")] |
| 441 options.arch = ",".join([tokens[0] for tokens in options.arch_and_mode]) | 465 options.arch = ",".join([tokens[0] for tokens in options.arch_and_mode]) |
| 442 options.mode = ",".join([tokens[1] for tokens in options.arch_and_mode]) | 466 options.mode = ",".join([tokens[1] for tokens in options.arch_and_mode]) |
| 443 options.mode = options.mode.split(",") | 467 options.mode = options.mode.split(",") |
| 444 for mode in options.mode: | 468 for mode in options.mode: |
| 445 if not BuildbotToV8Mode(mode) in MODES: | 469 if not BuildbotToV8Mode(mode) in MODES: |
| 446 print "Unknown mode %s" % mode | 470 print "Unknown mode %s" % mode |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 660 def Execute(arch, mode, args, options, suites): | 684 def Execute(arch, mode, args, options, suites): |
| 661 print(">>> Running tests for %s.%s" % (arch, mode)) | 685 print(">>> Running tests for %s.%s" % (arch, mode)) |
| 662 | 686 |
| 663 shell_dir = options.shell_dir | 687 shell_dir = options.shell_dir |
| 664 if not shell_dir: | 688 if not shell_dir: |
| 665 if options.buildbot: | 689 if options.buildbot: |
| 666 # TODO(machenbach): Get rid of different output folder location on | 690 # TODO(machenbach): Get rid of different output folder location on |
| 667 # buildbot. Currently this is capitalized Release and Debug. | 691 # buildbot. Currently this is capitalized Release and Debug. |
| 668 shell_dir = os.path.join(BASE_DIR, options.outdir, mode) | 692 shell_dir = os.path.join(BASE_DIR, options.outdir, mode) |
| 669 mode = BuildbotToV8Mode(mode) | 693 mode = BuildbotToV8Mode(mode) |
| 694 elif options.auto_detect: | |
| 695 # If an output dir with a build was passed, test directly in that | |
| 696 # directory. | |
| 697 shell_dir = os.path.join(BASE_DIR, options.outdir) | |
| 670 else: | 698 else: |
| 671 shell_dir = os.path.join( | 699 shell_dir = os.path.join( |
| 672 BASE_DIR, | 700 BASE_DIR, |
| 673 options.outdir, | 701 options.outdir, |
| 674 "%s.%s" % (arch, MODES[mode]["output_folder"]), | 702 "%s.%s" % (arch, MODES[mode]["output_folder"]), |
| 675 ) | 703 ) |
| 676 if not os.path.exists(shell_dir): | 704 if not os.path.exists(shell_dir): |
| 677 raise Exception('Could not find shell_dir: "%s"' % shell_dir) | 705 raise Exception('Could not find shell_dir: "%s"' % shell_dir) |
| 678 | 706 |
| 679 # Populate context object. | 707 # Populate context object. |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 705 options.random_seed, | 733 options.random_seed, |
| 706 options.no_sorting, | 734 options.no_sorting, |
| 707 options.rerun_failures_count, | 735 options.rerun_failures_count, |
| 708 options.rerun_failures_max, | 736 options.rerun_failures_max, |
| 709 options.predictable, | 737 options.predictable, |
| 710 options.no_harness, | 738 options.no_harness, |
| 711 use_perf_data=not options.swarming, | 739 use_perf_data=not options.swarming, |
| 712 sancov_dir=options.sancov_dir) | 740 sancov_dir=options.sancov_dir) |
| 713 | 741 |
| 714 # TODO(all): Combine "simulator" and "simulator_run". | 742 # TODO(all): Combine "simulator" and "simulator_run". |
| 743 # TODO(machenbach): In GN we can derive simulator run from | |
| 744 # target_arch != v8_target_arch in the dumped build config. | |
| 715 simulator_run = not options.dont_skip_simulator_slow_tests and \ | 745 simulator_run = not options.dont_skip_simulator_slow_tests and \ |
| 716 arch in ['arm64', 'arm', 'mipsel', 'mips', 'mips64', 'mips64el', \ | 746 arch in ['arm64', 'arm', 'mipsel', 'mips', 'mips64', 'mips64el', \ |
| 717 'ppc', 'ppc64'] and \ | 747 'ppc', 'ppc64'] and \ |
| 718 ARCH_GUESS and arch != ARCH_GUESS | 748 ARCH_GUESS and arch != ARCH_GUESS |
| 719 # Find available test suites and read test cases from them. | 749 # Find available test suites and read test cases from them. |
| 720 variables = { | 750 variables = { |
| 721 "arch": arch, | 751 "arch": arch, |
| 722 "asan": options.asan, | 752 "asan": options.asan, |
| 723 "deopt_fuzzer": False, | 753 "deopt_fuzzer": False, |
| 724 "gc_stress": options.gc_stress, | 754 "gc_stress": options.gc_stress, |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 847 "--coverage-dir=%s" % options.sancov_dir]) | 877 "--coverage-dir=%s" % options.sancov_dir]) |
| 848 except: | 878 except: |
| 849 print >> sys.stderr, "Error: Merging sancov files failed." | 879 print >> sys.stderr, "Error: Merging sancov files failed." |
| 850 exit_code = 1 | 880 exit_code = 1 |
| 851 | 881 |
| 852 return exit_code | 882 return exit_code |
| 853 | 883 |
| 854 | 884 |
| 855 if __name__ == "__main__": | 885 if __name__ == "__main__": |
| 856 sys.exit(Main()) | 886 sys.exit(Main()) |
| OLD | NEW |