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

Unified Diff: build/android/pylib/host_driven/test_info_collection.py

Issue 14704006: Add option to exclude specific annotated Android instrumentation tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Yet another typo fixed 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: build/android/pylib/host_driven/test_info_collection.py
diff --git a/build/android/pylib/host_driven/test_info_collection.py b/build/android/pylib/host_driven/test_info_collection.py
index fc4e806941a08102840abd88b7900d4460832128..5a7d467b2607659c1e4f1e2ce17c1140ad07ced7 100644
--- a/build/android/pylib/host_driven/test_info_collection.py
+++ b/build/android/pylib/host_driven/test_info_collection.py
@@ -64,11 +64,14 @@ class TestInfoCollection(object):
"""
self.all_tests = test_infos
- def GetAvailableTests(self, annotation, name_filter):
+ def GetAvailableTests(self, annotations, exclude_annotations, name_filter):
"""Get a collection of TestInfos which match the supplied criteria.
Args:
- annotation: annotation which tests must match, if any
+ annotations: List of annotations. Each test in the returned list is
+ annotated with atleast one of these annotations.
+ exlcude_annotations: List of annotations. The tests in the returned
+ list are not annotated with any of these annotations.
name_filter: name filter which tests must match, if any
Returns:
@@ -79,8 +82,8 @@ class TestInfoCollection(object):
# Filter out tests which match neither the requested annotation, nor the
# requested name filter, if any.
available_tests = [t for t in available_tests if
- self._AnnotationIncludesTest(t, annotation)]
- if annotation and len(annotation) == 1 and annotation[0] == 'SmallTest':
+ self._AnnotationIncludesTest(t, annotations)]
+ if annotations and len(annotations) == 1 and annotations[0] == 'SmallTest':
tests_without_annotation = [
t for t in self.all_tests if
not tests_annotations.AnnotatedFunctions.GetTestAnnotations(
@@ -90,6 +93,9 @@ class TestInfoCollection(object):
'Assuming "SmallTest":\n%s',
'\n'.join(test_names))
available_tests += tests_without_annotation
+ excluded_tests = [t for t in available_tests if
+ self._AnnotationIncludesTest(t, exclude_annotations)]
+ available_tests = list(set(available_tests) - set(excluded_tests))
available_tests = [t for t in available_tests if
self._NameFilterIncludesTest(t, name_filter)]
« no previous file with comments | « build/android/pylib/host_driven/run_python_tests.py ('k') | build/android/pylib/instrumentation/dispatch.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698