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

Unified Diff: build/android/pylib/instrumentation/instrumentation_test_instance.py

Issue 2580943002: Fix negative gtest filters for instrumentation tests. (Closed)
Patch Set: Reenabled test for negative filters Created 4 years 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 | build/android/pylib/instrumentation/instrumentation_test_instance_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/instrumentation/instrumentation_test_instance.py
diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance.py b/build/android/pylib/instrumentation/instrumentation_test_instance.py
index c11fd5fc546d598a3b356ffa7b1e418fc91916e7..8bfe4b3f30dfc9bd0bdd1ec0f52872b8afdaa3c7 100644
--- a/build/android/pylib/instrumentation/instrumentation_test_instance.py
+++ b/build/android/pylib/instrumentation/instrumentation_test_instance.py
@@ -235,7 +235,15 @@ def FilterTests(tests, test_filter=None, annotations=None,
GetTestName(unqualified_class_test, sep='.'),
GetUniqueTestName(t, sep='.')
]
- return unittest_util.FilterTestNames(names, test_filter)
+
+ pattern_groups = test_filter.split('-')
+ if len(pattern_groups) > 1:
+ negative_filter = pattern_groups[1]
+ if unittest_util.FilterTestNames(names, negative_filter):
+ return []
+
+ positive_filter = pattern_groups[0]
+ return unittest_util.FilterTestNames(names, positive_filter)
def annotation_filter(all_annotations):
if not annotations:
« no previous file with comments | « no previous file | build/android/pylib/instrumentation/instrumentation_test_instance_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698