开发者

Android instrumentation doesn't see my unit tests

开发者 https://www.devze.com 2023-03-08 14:55 出处:网络
I use http://code.google开发者_开发技巧.com/p/the-missing-android-xml-junit-test-runner/ to run unit tests in jenkins environment.

I use http://code.google开发者_开发技巧.com/p/the-missing-android-xml-junit-test-runner/ to run unit tests in jenkins environment.

One sample project worked well, but for another there are strange results. Ant outputs

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

and so does adb shell am instrument -w com.mypack.tests/pl.polidea.instrumentation.PolideaInstrumentationTestRunner.

It thinks that there are no tests but there are. They successfully run from eclipse.


The reason was: in build.properties there was relative source.dir. Something like:

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

It compiled well, but prevented tests to run. When I set paths to absolute:

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

tests do run.

0

精彩评论

暂无评论...
验证码 换一张
取 消