Commit c4667365 authored by mcdavid's avatar mcdavid Committed by Commit bot

Make test_runner allow exclude_annotations along with test filters

When running android instrumentation tests through test_runner, the
exclude_annotations rules will now take precedence over the test
filters, instead of being ignored.

BUG=425297

Review URL: https://codereview.chromium.org/668793002

Cr-Commit-Position: refs/heads/master@{#300486}
parent c2772795
...@@ -105,6 +105,7 @@ Darshini KN <kn.darshini@samsung.com> ...@@ -105,6 +105,7 @@ Darshini KN <kn.darshini@samsung.com>
David Benjamin <davidben@mit.edu> David Benjamin <davidben@mit.edu>
David Erceg <erceg.david@gmail.com> David Erceg <erceg.david@gmail.com>
David Futcher <david.mike.futcher@gmail.com> David Futcher <david.mike.futcher@gmail.com>
David McAllister <mcdavid@amazon.com>
Deepak Dilip Borade <deepak.db@samsung.com> Deepak Dilip Borade <deepak.db@samsung.com>
Deepak Mittal <deepak.m1@samsung.com> Deepak Mittal <deepak.m1@samsung.com>
Deepak Singla <deepak.sa@samsung.com> Deepak Singla <deepak.sa@samsung.com>
......
...@@ -268,13 +268,14 @@ class TestJar(object): ...@@ -268,13 +268,14 @@ class TestJar(object):
'%s has no annotations. Assuming "%s".', test, '%s has no annotations. Assuming "%s".', test,
self._DEFAULT_ANNOTATION) self._DEFAULT_ANNOTATION)
available_tests.append(test) available_tests.append(test)
if exclude_annotation_list:
excluded_tests = self.GetAnnotatedTests(exclude_annotation_list)
available_tests = list(set(available_tests) - set(excluded_tests))
else: else:
available_tests = [m for m in self.GetTestMethods() available_tests = [m for m in self.GetTestMethods()
if not self.IsHostDrivenTest(m)] if not self.IsHostDrivenTest(m)]
if exclude_annotation_list:
excluded_tests = self.GetAnnotatedTests(exclude_annotation_list)
available_tests = list(set(available_tests) - set(excluded_tests))
tests = [] tests = []
if test_filter: if test_filter:
# |available_tests| are in adb instrument format: package.path.class#test. # |available_tests| are in adb instrument format: package.path.class#test.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment