gpt4 book ai didi

Android Instrumentation 测试运行程序 : How to filter multiple test annotations

转载 作者:行者123 更新时间:2023-11-28 20:52:22 25 4
gpt4 key购买 nike

instrument 的文档清楚地说明了如何从测试运行中过滤单个测试注释:

Filter test run to tests without given annotation: adb shell am instrument -w -e notAnnotation com.android.foo.MyAnnotation com.android.foo/android.test.InstrumentationTestRunner

(来自 https://developer.android.com/reference/android/test/InstrumentationTestRunner.html)

是否可以过滤多个注解?到目前为止,我还没有找到有效的语法。我试过:

  • adb shell am instrument -w -e notAnnotation com.android.foo.MyAnnotation -e notAnnotation com.android.foo.AnotherAnnotation com.android.foo/android.test.InstrumentationTestRunner
  • adb shell am instrument -w -e notAnnotation com.android.foo.MyAnnotation,com.android.foo.AnotherAnnotation com.android.foo/android.test.InstrumentationTestRunner
  • adb shell am instrument -w -e notAnnotation com.android.foo.MyAnnotation com.android.foo.AnotherAnnotation com.android.foo/android.test.InstrumentationTestRunner
  • adb shell am instrument -w -e notAnnotation "com.android.foo.MyAnnotation","com.android.foo.AnotherAnnotation"com.android.foo/android.test.InstrumentationTestRunner

可能还有其他我已经忘记的,到目前为止都无济于事。

有人知道怎么做吗?

最佳答案

你应该使用 AndroidJUnitRunner无论如何:

Filter test run to tests without any of a list of annotations:

adb shell am instrument -w -e notAnnotation com.android.foo.MyAnnotation,com.android.foo.AnotherAnnotation com.android.foo/android.support.test.runner.AndroidJUnitRunner

关于Android Instrumentation 测试运行程序 : How to filter multiple test annotations,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41270114/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com