Setting up an unified coverage report in Android with Jacoco, Robolectric, and Espresso
Rafael Toledo
6013
Hi, a quick tip for anyone using the latest android gradle plugin (currently 2.2.0-rc1):
The naming convention for the instrumentation tests coverage file has changed. Now it includes the name of the device used for testing. So in order to include the coverage properly, you have to scan for all coverage files in that folder (assuming you want to merge tests from all devices).
Like this:
def instrumentationCoverage = fileTree(dir: “${buildDir}/outputs/code-coverage/connected”, include: “*.ec”)
executionData = files([“${buildDir}/jacoco/testDebugUnitTest.exec”, instrumentationCoverage])
Could you maybe make an edit to the article, so that it’s not buried down here in the comments? :)