我怎样才能 运行 '@SmallTest' 和 '@MediumTest' 而不是 '@LargeTest'?

How can I run both '@SmallTest' and '@MediumTest' and not '@LargeTest'?

详情:

我希望能够 运行 所有 @SmallTest@MediumTest 测试,同时忽略 @LargeTest 测试。

看起来Android ADB 检测命令支持否定。例如,您可以否定 annotation,例如 notAnnotation,但我没有看到 sizenotSize

理想情况下,最好有类似的东西:adb shell am instrument -w -e notSize large com.android.foo/android.support.test.runner.AndroidJUnitRunner

我宁愿不创建自定义注释然后被迫重新注释我的所有测试。

我试过以下方法:

参考资料

使用 notAnnotation 并指定 LargeTest 的完全限定路径:

adb shell am instrument -w -e notAnnotation android.support.test.filters.LargeTest com.android.foo/android.support.test.runner.AndroidJUnitRunner