2

Has anyone tried to integrate JaCoCo with Sonar for integration test coverage in Android?

My project contains two modules:

  • android library module (library),
  • android module with instrumentation tests for library (library-integration-tests).

Here I found out that it is quite easy to generate JaCoCo test report for instrumentation tests, by adding:

    buildTypes {
        debug {
           testCoverageEnabled true
        }
    }

to build.gradle of library-integration-tests and running ./gradlew createDebugCoverageReport. However I end up with empty coverage report. It works fine, when instrumentation tests are in the same module - the report is generated correctly then.

Although ./gradlew createDebugCoverageReport does not generate any .exec file, which is required by Sonar.

Gradle version: 2.2.1

JaCoCo version: 0.7.1.201405082137

Any help will be appreciated.

Community
  • 1
  • 1
mrtowel
  • 278
  • 2
  • 11

0 Answers0