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

Unified Diff: chrome/test/pylib/common/unittest_util.py

Issue 14882007: Android: support glob-style gtest filters with content browser tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use existing gtest filter evaluation code. Created 7 years, 7 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
Index: chrome/test/pylib/common/unittest_util.py
diff --git a/chrome/test/pylib/common/unittest_util.py b/chrome/test/pylib/common/unittest_util.py
index 9de980515bc599c52689b6c880747437d15e5b7f..bf4041dae988a816e589d7e4646840a8b2e8e759 100644
--- a/chrome/test/pylib/common/unittest_util.py
+++ b/chrome/test/pylib/common/unittest_util.py
@@ -101,10 +101,17 @@ def FilterTestSuite(suite, gtest_filter):
def FilterTests(all_tests, gtest_filter):
- """Returns a filtered list of tests based on the given gtest filter.
+ """Filter a list of tests based on the given gtest filter.
See http://code.google.com/p/googletest/wiki/AdvancedGuide
for gtest_filter specification.
+
+ Args:
+ all_tests: List of tests (unittest.TestSuite) or test names.
+ gtest_filter: Filter to apply.
+
+ Returns:
+ Filtered subset of the given list of tests.
"""
pattern_groups = gtest_filter.split('-')
positive_patterns = pattern_groups[0].split(':')
@@ -114,7 +121,7 @@ def FilterTests(all_tests, gtest_filter):
tests = []
for test in all_tests:
- test_name = GetTestName(test)
+ test_name = test if isinstance(test, str) else GetTestName(test)
# Test name must by matched by one positive pattern.
for pattern in positive_patterns:
if fnmatch.fnmatch(test_name, pattern):
« build/android/pylib/browsertests/dispatch.py ('K') | « build/android/pylib/browsertests/dispatch.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698