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

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

Issue 1251363002: [test] Let test runner only use exact matches of tests on the cmd-line. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review Created 5 years, 5 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 | « no previous file | 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 91a3e045258f3c7509b4d7cfe1806ecbd0dcbafe..133c74eefba74c13c95b4043c5f05cd4022d1522 100644
--- a/tools/testrunner/local/testsuite.py
+++ b/tools/testrunner/local/testsuite.py
@@ -175,8 +175,15 @@ class TestSuite(object):
print("Unused rule: %s -> %s" % (rule, self.wildcards[rule]))
def FilterTestCasesByArgs(self, args):
+ """Filter test cases based on command-line arguments.
+
+ An argument with an asterisk in the end will match all test cases
+ that have the argument as a prefix. Without asterisk, only exact matches
+ will be used with the exeption of the test-suite name as argument.
+ """
filtered = []
- filtered_args = []
+ globs = []
+ exact_matches = []
for a in args:
argpath = a.split(os.path.sep)
if argpath[0] != self.name:
@@ -186,12 +193,18 @@ class TestSuite(object):
path = os.path.sep.join(argpath[1:])
if path[-1] == '*':
path = path[:-1]
- filtered_args.append(path)
+ globs.append(path)
+ else:
+ exact_matches.append(path)
for t in self.tests:
- for a in filtered_args:
+ for a in globs:
if t.path.startswith(a):
filtered.append(t)
break
+ for a in exact_matches:
+ if t.path == a:
+ filtered.append(t)
+ break
self.tests = filtered
def GetFlagsForTestCase(self, testcase, context):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698