Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: tools/testrunner/local/testsuite.py

Issue 2203013002: [test] Enable test status filtering by variant (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Nits Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/testrunner/local/statusfile_unittest.py ('k') | tools/testrunner/local/testsuite_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testrunner/local/testsuite.py
diff --git a/tools/testrunner/local/testsuite.py b/tools/testrunner/local/testsuite.py
index b4e1856bf6e5b89f4ca6b4b285c76e22b263de77..8b12e565aec600ae2ac7b39d4d28fd3d0cfc470d 100644
--- a/tools/testrunner/local/testsuite.py
+++ b/tools/testrunner/local/testsuite.py
@@ -33,33 +33,9 @@ from . import commands
from . import statusfile
from . import utils
from ..objects import testcase
+from variants import ALL_VARIANTS, ALL_VARIANT_FLAGS, FAST_VARIANT_FLAGS
+
-# Use this to run several variants of the tests.
-ALL_VARIANT_FLAGS = {
- "default": [[]],
- "stress": [["--stress-opt", "--always-opt"]],
- "turbofan": [["--turbo"]],
- "turbofan_opt": [["--turbo", "--always-opt"]],
- "nocrankshaft": [["--nocrankshaft"]],
- "ignition": [["--ignition"]],
- "ignition_turbofan": [["--ignition-staging", "--turbo"]],
- "preparser": [["--min-preparse-length=0"]],
-}
-
-# FAST_VARIANTS implies no --always-opt.
-FAST_VARIANT_FLAGS = {
- "default": [[]],
- "stress": [["--stress-opt"]],
- "turbofan": [["--turbo"]],
- "nocrankshaft": [["--nocrankshaft"]],
- "ignition": [["--ignition"]],
- "ignition_turbofan": [["--ignition-staging", "--turbo"]],
- "preparser": [["--min-preparse-length=0"]],
-}
-
-ALL_VARIANTS = set(["default", "stress", "turbofan", "turbofan_opt",
- "nocrankshaft", "ignition", "ignition_turbofan",
- "preparser"])
FAST_VARIANTS = set(["default", "turbofan"])
STANDARD_VARIANT = set(["default"])
IGNITION_VARIANT = set(["ignition"])
@@ -153,8 +129,9 @@ class TestSuite(object):
pass
def ReadStatusFile(self, variables):
- (self.rules, self.wildcards) = \
- statusfile.ReadStatusFile(self.status_file(), variables)
+ with open(self.status_file()) as f:
+ self.rules, self.wildcards = (
+ statusfile.ReadStatusFile(f.read(), variables))
def ReadTestCases(self, context):
self.tests = self.ListTests(context)
@@ -169,18 +146,40 @@ class TestSuite(object):
def FilterTestCasesByStatus(self, warn_unused_rules,
slow_tests="dontcare",
- pass_fail_tests="dontcare"):
+ pass_fail_tests="dontcare",
+ variants=False):
+
+ # Use only variants-dependent rules and wildcards when filtering
+ # respective test cases and generic rules when filtering generic test
+ # cases.
+ if not variants:
+ rules = self.rules[""]
+ wildcards = self.wildcards[""]
+ else:
+ # We set rules and wildcards to a variant-specific version for each test
+ # below.
+ rules = {}
+ wildcards = {}
+
filtered = []
+
+ # Remember used rules as tuples of (rule, variant), where variant is "" for
+ # variant-independent rules.
used_rules = set()
+
for t in self.tests:
slow = False
pass_fail = False
testname = self.CommonTestName(t)
- if testname in self.rules:
- used_rules.add(testname)
+ variant = t.variant or ""
+ if variants:
+ rules = self.rules[variant]
+ wildcards = self.wildcards[variant]
+ if testname in rules:
+ used_rules.add((testname, variant))
# Even for skipped tests, as the TestCase object stays around and
# PrintReport() uses it.
- t.outcomes = self.rules[testname]
+ t.outcomes |= rules[testname]
if statusfile.DoSkip(t.outcomes):
continue # Don't add skipped tests to |filtered|.
for outcome in t.outcomes:
@@ -189,14 +188,14 @@ class TestSuite(object):
slow = statusfile.IsSlow(t.outcomes)
pass_fail = statusfile.IsPassOrFail(t.outcomes)
skip = False
- for rule in self.wildcards:
+ for rule in wildcards:
assert rule[-1] == '*'
if testname.startswith(rule[:-1]):
- used_rules.add(rule)
- t.outcomes |= self.wildcards[rule]
+ used_rules.add((rule, variant))
+ t.outcomes |= wildcards[rule]
if statusfile.DoSkip(t.outcomes):
skip = True
- break # "for rule in self.wildcards"
+ break # "for rule in wildcards"
slow = slow or statusfile.IsSlow(t.outcomes)
pass_fail = pass_fail or statusfile.IsPassOrFail(t.outcomes)
if (skip
@@ -209,12 +208,26 @@ class TestSuite(object):
if not warn_unused_rules:
return
- for rule in self.rules:
- if rule not in used_rules:
- print("Unused rule: %s -> %s" % (rule, self.rules[rule]))
- for rule in self.wildcards:
- if rule not in used_rules:
- print("Unused rule: %s -> %s" % (rule, self.wildcards[rule]))
+ if not variants:
+ for rule in self.rules[""]:
+ if (rule, "") not in used_rules:
+ print("Unused rule: %s -> %s (variant independent)" % (
+ rule, self.rules[""][rule]))
+ for rule in self.wildcards[""]:
+ if (rule, "") not in used_rules:
+ print("Unused rule: %s -> %s (variant independent)" % (
+ rule, self.wildcards[""][rule]))
+ else:
+ for variant in ALL_VARIANTS:
+ for rule in self.rules[variant]:
+ if (rule, variant) not in used_rules:
+ print("Unused rule: %s -> %s (variant: %s)" % (
+ rule, self.rules[variant][rule], variant))
+ for rule in self.wildcards[variant]:
+ if (rule, variant) not in used_rules:
+ print("Unused rule: %s -> %s (variant: %s)" % (
+ rule, self.wildcards[variant][rule], variant))
+
def FilterTestCasesByArgs(self, args):
"""Filter test cases based on command-line arguments.
« no previous file with comments | « tools/testrunner/local/statusfile_unittest.py ('k') | tools/testrunner/local/testsuite_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698