Hi Brad,
Please have a look at
to me seems that not counting Gradle it describes exactly your case where tests in one module cover classes in another module.
EclEmma itself is structured like that and uses Maven - e.g. tests in module org.eclipse.eclemma.core.test
cover classes in module org.eclipse.eclemma.core
. And EclEmma is configured as described in mentioned above post:
Most common trick to cross boundaries - is to collect all coverage information into single location.
This allows to see combined coverage even in case when both modules have tests.
Here is EclEmma configuration:
Result is available at SonarCloud : SonarCloud
Above post also mentions another trick:
SonarQube 6.2 with Java Plugin 4.4 supports property sonar.jacoco.reportPaths allowing to specify multiple locations.
This also allows to see combined coverage even in case when both modules have tests.
For the completeness of picture should be mentioned that JaCoCo itself structured exactly like EclEmma and also uses Maven - tests in module org.jacoco.core.test
cover classes in module org.jacoco.core
, however configured differently:
such configuration also allows to see coverage produced by tests in org.jacoco.core.tests
in SonarQube - https://sonarcloud.io/dashboard?id=org.jacoco%3Aorg.jacoco.build , however if one day org.jacoco.core
will contain tests, then coverage produced by them won’t be shown in SonarQube.