我正在Jenkins服务器上使用Maven对我的Android应用程序进行单元测试。
一切都按预期工作,但是当我想指定多个包用于测试时,单元测试不再执行。也许这只是我对pom.xml中语法的误解?我认为你可以为单元测试添加多个包。
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<test>
<createReport>true</createReport>
<packages>
<!-- just one package works without problem -->
<package>a.b.c</package>
<package>a.b.d</package>
</packages>
</test>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
答案 0 :(得分:2)
执行包的adb文档位于:http://developer.android.com/tools/testing/testing_otheride.html#RunTestsCommand
要运行单个测试包,语法为:
adb shell am instrument -w <test_package_name>/<runner_class>
我认为没有办法在单个命令行中运行多个测试包。因此,由于maven插件应该是adb的包装器,我想我们不可能实现你想要的。
您可以使用配置文件运行不同的测试包。