android junit report
The Android JUnit report test runner is a custom instrumentation test runner for Android that creates XML test reports. These reports are in a similar format to those created by the Ant JUnit task's XML formatter, allowing them to be integrated with tools that support that format (e.g. continuous integration servers link Pulse).
Simply configure your Android test project to use this test runner rather than the default, then pull the reports from the Android device for parsing by your builds tool of choice.
For the impatient, here is an overview of how to integrate the runner with Ant builds. Note all modifications are made to your test project, i.e. the project which implements the JUnit tests:
Grab the jar from the downloads page and add it
ant.propertiesto add the line:
Run your tests as you would normally:
$ ant debug install test
Pull the resulting XML report from the device (from the application under test's internal storage directory):
$ adb pull /data/data/<main app package>/files/junit-report.xml
- Integrate the XML with your chosen build tool.
In practice you may want to tweak the report location, add the last pull step to your build, and more. For details, see the documentation page.
Want to learn more? Check out the following resources:
- Full project documentation.
- GitHub project page.
- Example project.
- Blog posts (warning: some information may be out of date):
If you have any thoughts, questions etc about the runner, you can contact me at:
Or you can submit an issue or pull request via GitHub. All feedback is welcome.