我有一个常规:app
模块和一个 DFM :feature
。
我将 DFM 的测试androidTest
放在里面的源集中:feature
。
当我尝试使用 Android Studio 创建的运行配置启动测试时,它会以Test framework quit unexpectedly
.
如果我使用 Android Studio 在选项卡中显示的命令通过终端启动测试,Run
我将看到:
$ adb shell am instrument -w -m -e debug false -e class 'com.amazing.feature.AmazingTest' com.amazing.application.test/com.amazing.feature.TestRunner
...
Unable to find instrumentation info for: ComponentInfo{com.amazing.application.test/com.amazing.feature.TestRunner}
这并不奇怪,因为通往跑步者的道路是不同的:
$ adb shell pm list instrumentation
instrumentation:com.amazing.feature.test/com.amazing.feature.TestRunner (target=com.amazing.application)
如果我在命令行上使用该工具,则测试有效。
有没有办法教 Android Studio 做到这一点?