In my JaCoCo code coverage reports for my espresso tests, all lines and branches are missed. I am using JaCoCo in an Android application which is built with gradle 1.5.0.
My gradle configuration:
apply plugin: 'jacoco'
android {
buildTypes {
debug {
testCoverageEnabled = true
}
}
}
jacoco {
version '0.7.5.201505241946'
}
I followed this blog post: Test coverage report for Android application.
When I run createDebugCoverageReport
, the report is generated in the correct folder (build/reports/coverage/flavor/debug/index.html). However, when I open the coverage report, my code coverage is 0% on every instructions and branches. Everything is "missed".
First I thought that the problem could be the location of the source code and test code, but they are located in /src/main/java/
and /src/androidTest/java/
Anyone has an idea how to fix this?