summaryrefslogtreecommitdiff
path: root/chromium/v8/tools/run-tests.py
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-01-04 14:17:57 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-01-05 10:05:06 +0000
commit39d357e3248f80abea0159765ff39554affb40db (patch)
treeaba0e6bfb76de0244bba0f5fdbd64b830dd6e621 /chromium/v8/tools/run-tests.py
parent87778abf5a1f89266f37d1321b92a21851d8244d (diff)
downloadqtwebengine-chromium-39d357e3248f80abea0159765ff39554affb40db.tar.gz
BASELINE: Update Chromium to 55.0.2883.105
And updates ninja to 1.7.2 Change-Id: I20d43c737f82764d857ada9a55586901b18b9243 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/v8/tools/run-tests.py')
-rwxr-xr-xchromium/v8/tools/run-tests.py154
1 files changed, 103 insertions, 51 deletions
diff --git a/chromium/v8/tools/run-tests.py b/chromium/v8/tools/run-tests.py
index b1c71dd0a76..f248dff5cc3 100755
--- a/chromium/v8/tools/run-tests.py
+++ b/chromium/v8/tools/run-tests.py
@@ -30,10 +30,11 @@
from collections import OrderedDict
import itertools
+import json
import multiprocessing
import optparse
import os
-from os.path import join
+from os.path import getmtime, isdir, join
import platform
import random
import shlex
@@ -44,7 +45,7 @@ import time
from testrunner.local import execution
from testrunner.local import progress
from testrunner.local import testsuite
-from testrunner.local.testsuite import ALL_VARIANTS
+from testrunner.local.variants import ALL_VARIANTS
from testrunner.local import utils
from testrunner.local import verbose
from testrunner.network import network_execution
@@ -54,6 +55,8 @@ from testrunner.objects import context
# Base dir of the v8 checkout to be used as cwd.
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+DEFAULT_OUT_GN = "out.gn"
+
ARCH_GUESS = utils.DefaultArch()
# Map of test name synonyms to lists of test suites. Should be ordered by
@@ -81,13 +84,6 @@ TEST_MAP = {
"intl",
"unittests",
],
- # This needs to stay in sync with test/ignition.isolate.
- "ignition": [
- "mjsunit",
- "cctest",
- "webkit",
- "message",
- ],
# This needs to stay in sync with test/optimize_for_size.isolate.
"optimize_for_size": [
"mjsunit",
@@ -102,14 +98,26 @@ TEST_MAP = {
TIMEOUT_DEFAULT = 60
-VARIANTS = ["default", "stress", "turbofan"]
+VARIANTS = ["default", "turbofan", "ignition_staging"]
-EXHAUSTIVE_VARIANTS = VARIANTS + [
+MORE_VARIANTS = [
"ignition",
- "nocrankshaft",
+ "stress",
"turbofan_opt",
+ "asm_wasm",
]
+EXHAUSTIVE_VARIANTS = VARIANTS + MORE_VARIANTS
+
+VARIANT_ALIASES = {
+ # The default for developer workstations.
+ "dev": VARIANTS,
+ # Additional variants, run on all bots.
+ "more": MORE_VARIANTS,
+ # Additional variants, run on a subset of bots.
+ "extra": ["nocrankshaft"],
+}
+
DEBUG_FLAGS = ["--nohard-abort", "--nodead-code-elimination",
"--nofold-constants", "--enable-slow-asserts",
"--debug-code", "--verify-heap"]
@@ -174,8 +182,6 @@ SUPPORTED_ARCHS = ["android_arm",
"mipsel",
"mips64",
"mips64el",
- "nacl_ia32",
- "nacl_x64",
"s390",
"s390x",
"ppc",
@@ -193,8 +199,6 @@ SLOW_ARCHS = ["android_arm",
"mipsel",
"mips64",
"mips64el",
- "nacl_ia32",
- "nacl_x64",
"s390",
"s390x",
"x87",
@@ -249,16 +253,11 @@ def BuildOptions():
result.add_option("--download-data", help="Download missing test suite data",
default=False, action="store_true")
result.add_option("--download-data-only",
- help="Download missing test suite data and exit",
+ help="Deprecated",
default=False, action="store_true")
result.add_option("--extra-flags",
help="Additional flags to pass to each test command",
default="")
- result.add_option("--ignition", help="Skip tests which don't run in ignition",
- default=False, action="store_true")
- result.add_option("--ignition-turbofan",
- help="Skip tests which don't run in ignition_turbofan",
- default=False, action="store_true")
result.add_option("--isolates", help="Whether to test isolates",
default=False, action="store_true")
result.add_option("-j", help="The number of parallel tasks to run",
@@ -278,7 +277,7 @@ def BuildOptions():
default=(utils.GuessOS() != "linux"),
dest="no_network", action="store_true")
result.add_option("--no-presubmit", "--nopresubmit",
- help='Skip presubmit checks',
+ help='Skip presubmit checks (deprecated)',
default=False, dest="no_presubmit", action="store_true")
result.add_option("--no-snap", "--nosnap",
help='Test a build compiled without snapshot.',
@@ -286,19 +285,20 @@ def BuildOptions():
result.add_option("--no-sorting", "--nosorting",
help="Don't sort tests according to duration of last run.",
default=False, dest="no_sorting", action="store_true")
- result.add_option("--no-stress", "--nostress",
- help="Don't run crankshaft --always-opt --stress-op test",
- default=False, dest="no_stress", action="store_true")
result.add_option("--no-variants", "--novariants",
help="Don't run any testing variants",
default=False, dest="no_variants", action="store_true")
result.add_option("--variants",
- help="Comma-separated list of testing variants: %s" % VARIANTS)
+ help="Comma-separated list of testing variants;"
+ " default: \"%s\"" % ",".join(VARIANTS))
result.add_option("--exhaustive-variants",
default=False, action="store_true",
- help="Use exhaustive set of default variants.")
+ help="Use exhaustive set of default variants:"
+ " \"%s\"" % ",".join(EXHAUSTIVE_VARIANTS))
result.add_option("--outdir", help="Base directory with compile output",
default="out")
+ result.add_option("--gn", help="Scan out.gn for the last built configuration",
+ default=False, action="store_true")
result.add_option("--predictable",
help="Compare output of several reruns of each test",
default=False, action="store_true")
@@ -332,9 +332,6 @@ def BuildOptions():
help="Don't skip more slow tests when using a simulator.",
default=False, action="store_true",
dest="dont_skip_simulator_slow_tests")
- result.add_option("--stress-only",
- help="Only run tests with --always-opt --stress-opt",
- default=False, action="store_true")
result.add_option("--swarming",
help="Indicates running test driver on swarming.",
default=False, action="store_true")
@@ -430,10 +427,51 @@ def SetupEnvironment(options):
])
def ProcessOptions(options):
- global ALL_VARIANTS
- 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.
+ options.auto_detect = False
+ if options.gn:
+ gn_out_dir = os.path.join(BASE_DIR, DEFAULT_OUT_GN)
+ latest_timestamp = -1
+ latest_config = None
+ for gn_config in os.listdir(gn_out_dir):
+ gn_config_dir = os.path.join(gn_out_dir, gn_config)
+ if not isdir(gn_config_dir):
+ continue
+ if os.path.getmtime(gn_config_dir) > latest_timestamp:
+ latest_timestamp = os.path.getmtime(gn_config_dir)
+ latest_config = gn_config
+ if latest_config:
+ print(">>> Latest GN build found is %s" % latest_config)
+ options.outdir = os.path.join(DEFAULT_OUT_GN, latest_config)
+
+ build_config_path = os.path.join(
+ BASE_DIR, options.outdir, "v8_build_config.json")
+ if os.path.exists(build_config_path):
+ try:
+ with open(build_config_path) as f:
+ build_config = json.load(f)
+ except Exception:
+ print ("%s exists but contains invalid json. Is your build up-to-date?" %
+ build_config_path)
+ return False
+ 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(".")
@@ -461,11 +499,7 @@ def ProcessOptions(options):
# Special processing of other options, sorted alphabetically.
if options.buildbot:
- # Buildbots run presubmit tests as a separate step.
- options.no_presubmit = True
options.no_network = True
- if options.download_data_only:
- options.no_presubmit = True
if options.command_prefix:
print("Specifying --command-prefix disables network distribution, "
"running tests locally.")
@@ -488,6 +522,8 @@ def ProcessOptions(options):
# Other options for manipulating variants still apply afterwards.
VARIANTS = EXHAUSTIVE_VARIANTS
+ # TODO(machenbach): Figure out how to test a bigger subset of variants on
+ # msan and tsan.
if options.msan:
VARIANTS = ["default"]
@@ -504,23 +540,25 @@ def ProcessOptions(options):
"""Returns true if zero or one of multiple arguments are true."""
return reduce(lambda x, y: x + y, args) <= 1
- if not excl(options.no_stress, options.stress_only, options.no_variants,
- bool(options.variants)):
- print("Use only one of --no-stress, --stress-only, --no-variants, "
- "or --variants.")
+ if not excl(options.no_variants, bool(options.variants)):
+ print("Use only one of --no-variants or --variants.")
return False
if options.quickcheck:
VARIANTS = ["default", "stress"]
options.slow_tests = "skip"
options.pass_fail_tests = "skip"
- if options.no_stress:
- VARIANTS = ["default", "nocrankshaft"]
if options.no_variants:
VARIANTS = ["default"]
- if options.stress_only:
- VARIANTS = ["stress"]
if options.variants:
VARIANTS = options.variants.split(",")
+
+ # Resolve variant aliases.
+ VARIANTS = reduce(
+ list.__add__,
+ (VARIANT_ALIASES.get(v, [v]) for v in VARIANTS),
+ [],
+ )
+
if not set(VARIANTS).issubset(ALL_VARIANTS):
print "All variants must be in %s" % str(ALL_VARIANTS)
return False
@@ -530,6 +568,9 @@ def ProcessOptions(options):
options.extra_flags.append("--verify_predictable")
options.extra_flags.append("--no-inline-new")
+ # Dedupe.
+ VARIANTS = list(set(VARIANTS))
+
if not options.shell_dir:
if options.shell:
print "Warning: --shell is deprecated, use --shell-dir instead."
@@ -607,10 +648,6 @@ def Main():
print ' '.join(sys.argv)
exit_code = 0
- if not options.no_presubmit:
- print ">>> running presubmit tests"
- exit_code = subprocess.call(
- [sys.executable, join(BASE_DIR, "tools", "presubmit.py")])
suite_paths = utils.GetSuitePaths(join(BASE_DIR, "test"))
@@ -648,6 +685,9 @@ def Main():
if options.download_data_only:
return exit_code
+ for s in suites:
+ s.PrepareSources()
+
for (arch, mode) in options.arch_and_mode:
try:
code = Execute(arch, mode, args, options, suites)
@@ -667,6 +707,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 +756,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 \
@@ -723,8 +769,6 @@ def Execute(arch, mode, args, options, suites):
"deopt_fuzzer": False,
"gc_stress": options.gc_stress,
"gcov_coverage": options.gcov_coverage,
- "ignition": options.ignition,
- "ignition_turbofan": options.ignition_turbofan,
"isolates": options.isolates,
"mode": MODES[mode]["status_mode"],
"no_i18n": options.no_i18n,
@@ -747,8 +791,12 @@ def Execute(arch, mode, args, options, suites):
if len(args) > 0:
s.FilterTestCasesByArgs(args)
all_tests += s.tests
+
+ # First filtering by status applying the generic rules (independent of
+ # variants).
s.FilterTestCasesByStatus(options.warn_unused, options.slow_tests,
options.pass_fail_tests)
+
if options.cat:
verbose.PrintTestSource(s.tests)
continue
@@ -776,6 +824,10 @@ def Execute(arch, mode, args, options, suites):
else:
s.tests = variant_tests
+ # Second filtering by status applying the variant-dependent rules.
+ s.FilterTestCasesByStatus(options.warn_unused, options.slow_tests,
+ options.pass_fail_tests, variants=True)
+
s.tests = ShardTests(s.tests, options)
num_tests += len(s.tests)