Add "annotation" and "not-annotation" args to runtest.
Bug 2239240
Change-Id: I49bbee4b74e8b0a51b6e6144818a7e9c08b1b5c2
diff --git a/testrunner/runtest.py b/testrunner/runtest.py
index 495b6a7..41063f1 100755
--- a/testrunner/runtest.py
+++ b/testrunner/runtest.py
@@ -120,6 +120,12 @@
help="Restrict test to a specific java package")
parser.add_option("-z", "--size", dest="test_size",
help="Restrict test to a specific test size")
+ parser.add_option("--annotation", dest="test_annotation",
+ help="Include only those tests tagged with a specific"
+ " annotation")
+ parser.add_option("--not-annotation", dest="test_not_annotation",
+ help="Excludes any tests tagged with a specific"
+ " annotation")
parser.add_option("-u", "--user-tests-file", dest="user_tests_file",
metavar="FILE", default=user_test_default,
help="Alternate source of user test definitions")
diff --git a/testrunner/test_defs/instrumentation_test.py b/testrunner/test_defs/instrumentation_test.py
index c932a0b..f0a8656 100644
--- a/testrunner/test_defs/instrumentation_test.py
+++ b/testrunner/test_defs/instrumentation_test.py
@@ -131,6 +131,10 @@
instrumentation_args["suiteAssignment"] = "true"
if options.coverage:
instrumentation_args["coverage"] = "true"
+ if options.test_annotation:
+ instrumentation_args["annotation"] = options.test_annotation
+ if options.test_not_annotation:
+ instrumentation_args["notAnnotation"] = options.test_not_annotation
if options.preview:
adb_cmd = adb.PreviewInstrumentationCommand(
package_name=self.GetPackageName(),