2011-05-27 63 views
1

我使用http://code.google.com/p/the-missing-android-xml-junit-test-runner/在jenkins环境中运行单元测试。Android仪器没有看到我的单元测试

一个示例项目运行良好,但另一个示例项目却出现了奇怪的结果。 蚂蚁输出

[echo] Running tests ... 
[exec] 
[exec] Test results for PolideaInstrumentationTestRunner= 
[exec] Time: 0.0 
[exec] 
[exec] OK (0 tests) 
[exec] 
[exec] 

也是如此ADB壳上午仪器-w com.mypack.tests/pl.polidea.instrumentation.PolideaInstrumentationTestRunner。

它认为没有测试,但有。他们成功从eclipse运行。

+0

尝试android.test.InstrumentationTestRunner来检测你的问题在哪里。 – 2011-05-27 14:08:03

+0

明白了!试图找出工程项目与不工程项目之间的差异。 – 2011-05-30 04:15:59

回答

1

原因是: 在build.properties中有相对的source.dir。喜欢的东西:

source.dir=src;./../../../other.package/src;./../../and.other/src

它编译良好,但阻止测试运行。当我设置路径绝对:

source.dir=${workspace}/my.package/src;${workspace}/other.package/src;${workspace}/and.other/src

测试并运行。

相关问题