Hi all,
I've a question about generating XML reports after unit tests. I want
to move build process to Hudson build server. It has plugins, which
can read JUnit and Emma reports in XML file format, parse them and
view in nice looking way. My first thought was to create ant
buildifle in which I would compile sources, add instrumentation and
run Junit tests with instrumentated code, and generate report (using
Emma and Junit tasks). It works fine but only when classes which don't
use Android classses (e.g. Log.d("TAG","Log message")) were tested.
I've found that this is because Android classes are available only in
actual runtime (real device, emulator) - trying to test not on
emulator caused runtime exception: "Stub!".
So I decided to do those tests in a way shown on Android developer
site. I created two projects: first with main application, an second
for test purposes. I installed those two on emulator, and executed
tests via:
<b>adb shell am instrument -w com.newbay.vault.test/
android.test.InstrumentationTestRunner</b>
It run tests but, there wasn't very verbose output. I executed next
command, to include coverage:
<b>adb shell am instrument -e coverage true -w com.newbay.vault.test/
android.test.InstrumentationTestRunner</b>
It created "coverage.ec" file on emulator which I was able to download
via "adb pull" command.
The problem is I need XML report from JUnit. Also - to generate Emma
report - two files are needed: "coverage.ec" (which is generated on
emulator) and "coverage.em" file (metadata) which I cannot find
anywhere.
Questions are:
1. Can I somehow force Android to generate XML report from JUnit test
results?
2. Where shall I look for metadata file ("coverage.em")?
3. Is it possible to successfully run tests without running emulator
instance?
I've found some posts on Google where "EMMA_INSTRUMENT=true" variable
was exported. Does this mean, that I have to compile SDK manually with
this variable defined to turn on "coverage.em" generation?
Thanks in advance four your answers
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en