summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorBrett Chabot <brettchabot@google.com>2014-01-28 01:08:43 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-01-28 01:08:43 +0000
commitb7e01285f755778b597752e007d3b232b33209c2 (patch)
tree4ddc87ef4690c55f55f91e9c2372505bc221720e /support
parent9f8c8eccbff903354af6410cc63921172e2686d7 (diff)
parent6cdf7a05a7a1437aea3c670a38b7112c5c158f2a (diff)
downloadtesting-b7e01285f755778b597752e007d3b232b33209c2.tar.gz
am 6cdf7a05: am 5c8e0271: DO NOT MERGE. Cherry pick \'Support multiple notAnnotation values\'
* commit '6cdf7a05a7a1437aea3c670a38b7112c5c158f2a': DO NOT MERGE. Cherry pick 'Support multiple notAnnotation values'
Diffstat (limited to 'support')
-rw-r--r--support/src/android/support/test/runner/AndroidJUnitRunner.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/support/src/android/support/test/runner/AndroidJUnitRunner.java b/support/src/android/support/test/runner/AndroidJUnitRunner.java
index cfc780a..b1114a1 100644
--- a/support/src/android/support/test/runner/AndroidJUnitRunner.java
+++ b/support/src/android/support/test/runner/AndroidJUnitRunner.java
@@ -111,6 +111,10 @@ import java.util.List;
* e.g. "-e size large -e notAnnotation com.android.foo.MyAnnotation" will run tests with
* the {@link LargeTest} annotation that do NOT have the "com.android.foo.MyAnnotation" annotations.
* <p/>
+ * <b>Filter test run to tests <i>without any</i> of a list of annotations:</b> adb shell am
+ * instrument -w -e notAnnotation com.android.foo.MyAnnotation,com.android.foo.AnotherAnnotation
+ * com.android.foo/com.android.test.runner.AndroidJUnitRunner
+ * <p/>
* <b>To run in 'log only' mode</b>
* -e log true
* This option will load and iterate through all test classes and methods, but will bypass actual
@@ -367,9 +371,11 @@ public class AndroidJUnitRunner extends Instrumentation {
builder.addAnnotationInclusionFilter(annotation);
}
- String notAnnotation = arguments.getString(ARGUMENT_NOT_ANNOTATION);
- if (notAnnotation != null) {
- builder.addAnnotationExclusionFilter(notAnnotation);
+ String notAnnotations = arguments.getString(ARGUMENT_NOT_ANNOTATION);
+ if (notAnnotations != null) {
+ for (String notAnnotation : notAnnotations.split(",")) {
+ builder.addAnnotationExclusionFilter(notAnnotation);
+ }
}
if (getBooleanArgument(ARGUMENT_LOG_ONLY)) {