Chromium Code Reviews| Index: tools/run-tests.py |
| diff --git a/tools/run-tests.py b/tools/run-tests.py |
| index b1c71dd0a76d7e12222dbf85a2465ab4e5dd1075..7e519cfcc4762d0883ebbbbb7603105c57a4da82 100755 |
| --- a/tools/run-tests.py |
| +++ b/tools/run-tests.py |
| @@ -30,6 +30,7 @@ |
| from collections import OrderedDict |
| import itertools |
| +import json |
| import multiprocessing |
| import optparse |
| import os |
| @@ -434,6 +435,29 @@ def ProcessOptions(options): |
| global EXHAUSTIVE_VARIANTS |
| global VARIANTS |
| + # First try to auto-detect configurations based on the build if GN was |
| + # 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.
|
| + options.auto_detect = False |
| + build_config_path = os.path.join( |
| + BASE_DIR, options.outdir, "v8_build_config.json") |
| + if os.path.exists(build_config_path): |
| + with open(build_config_path) as f: |
| + build_config = json.load(f) |
| + options.auto_detect = True |
| + |
| + options.arch_and_mode = None |
| + options.arch = build_config["v8_target_cpu"] |
| + if options.arch == 'x86': |
| + # TODO(machenbach): Transform all to x86 eventually. |
| + options.arch = 'ia32' |
| + options.asan = build_config["is_asan"] |
| + options.dcheck_always_on = build_config["dcheck_always_on"] |
| + options.mode = 'debug' if build_config["is_debug"] else 'release' |
| + options.msan = build_config["is_msan"] |
| + options.no_i18n = not build_config["v8_enable_i18n_support"] |
| + options.no_snap = not build_config["v8_use_snapshot"] |
| + options.tsan = build_config["is_tsan"] |
| + |
| # Architecture and mode related stuff. |
| if options.arch_and_mode: |
| options.arch_and_mode = [arch_and_mode.split(".") |
| @@ -667,6 +691,10 @@ def Execute(arch, mode, args, options, suites): |
| # buildbot. Currently this is capitalized Release and Debug. |
| shell_dir = os.path.join(BASE_DIR, options.outdir, mode) |
| mode = BuildbotToV8Mode(mode) |
| + elif options.auto_detect: |
| + # If an output dir with a build was passed, test directly in that |
| + # directory. |
| + shell_dir = os.path.join(BASE_DIR, options.outdir) |
| else: |
| shell_dir = os.path.join( |
| BASE_DIR, |
| @@ -712,6 +740,8 @@ def Execute(arch, mode, args, options, suites): |
| sancov_dir=options.sancov_dir) |
| # TODO(all): Combine "simulator" and "simulator_run". |
| + # TODO(machenbach): In GN we can derive simulator run from |
| + # target_arch != v8_target_arch in the dumped build config. |
| simulator_run = not options.dont_skip_simulator_slow_tests and \ |
| arch in ['arm64', 'arm', 'mipsel', 'mips', 'mips64', 'mips64el', \ |
| 'ppc', 'ppc64'] and \ |