Andrey Regentov
Andrey Regentov

Reputation: 3737

Android instrumentation doesn't see my unit tests

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.

Upvotes: 1

Views: 839

Answers (1)

Andrey Regentov
Andrey Regentov

Reputation: 3737

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.

Upvotes: 1

Related Questions