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

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: Move status lines and deprecate --ignition-turbofan flag 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
« tools/run-tests.py ('K') | « tools/run-tests.py ('k') | no next file » | 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..f3f64150b943778c3387559b143aad014b62bb55 100644
--- a/tools/testrunner/local/testsuite.py
+++ b/tools/testrunner/local/testsuite.py
@@ -132,6 +132,10 @@ class TestSuite(object):
else:
return testcase.path
+ def VirtualTestName(self, testcase):
+ """Returns the test path prefixed with the variant name."""
+ return "virtual/%s/%s" % (testcase.variant, self.CommonTestName(testcase))
+
def ListTests(self, context):
raise NotImplementedError
@@ -169,18 +173,27 @@ class TestSuite(object):
def FilterTestCasesByStatus(self, warn_unused_rules,
slow_tests="dontcare",
- pass_fail_tests="dontcare"):
+ pass_fail_tests="dontcare",
+ virtual=False):
+
+ # Use only virtual rules and wildcards when filtering virtual test cases
+ # and generic rules when filtering generic test cases.
+ filter_virtual = lambda d: {k:v for k,v in d.iteritems()
+ if not(virtual ^ k.startswith("virtual/"))}
+ rules = filter_virtual(self.rules)
+ wildcards = filter_virtual(self.wildcards)
+
filtered = []
used_rules = set()
for t in self.tests:
slow = False
pass_fail = False
- testname = self.CommonTestName(t)
- if testname in self.rules:
+ testname = self.VirtualTestName(t) if virtual else self.CommonTestName(t)
+ if testname in rules:
used_rules.add(testname)
# 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 +202,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]
+ 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 +222,12 @@ class TestSuite(object):
if not warn_unused_rules:
return
- for rule in self.rules:
+ for rule in rules:
if rule not in used_rules:
- print("Unused rule: %s -> %s" % (rule, self.rules[rule]))
- for rule in self.wildcards:
+ print("Unused rule: %s -> %s" % (rule, rules[rule]))
+ for rule in wildcards:
if rule not in used_rules:
- print("Unused rule: %s -> %s" % (rule, self.wildcards[rule]))
+ print("Unused rule: %s -> %s" % (rule, wildcards[rule]))
def FilterTestCasesByArgs(self, args):
"""Filter test cases based on command-line arguments.
« tools/run-tests.py ('K') | « tools/run-tests.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698