1
votes

I am facing a strange problem while running jacoco Instrumentation coverage.

SetUp -: - In app/build.gradle file I have put "apply plugin: 'jacoco'" - In debug variant under buildTypes I have put "testCoverageEnabled = true"

Run command -: ./gradlew createDebugCoverageReport

Result -: - Coverage report is generated under /Users/user/AndroidInstrTests/app/build/reports/coverage/debug/index.html. - But above index.html displays all coverage to be 0%. - This should not happened as I have run same test on Google Notepad app, My app with content provider Tests(Which called insert method of content provider), I also ran one espresso instrumentation Test but got coverage as 0%.

Jacoco Coverage report Instrumentation Tests

1

1 Answers

0
votes

It appears to be because you are running coverage reports for your test packages instead of your main packages?