To collect cross-module code coverage using jacoco offline instrumentation 
we need to add jars with instrumented classes to dependent module's 
classpath.
For more details please follow by the link: 
https://stackoverflow.com/questions/60009231/cross-module-code-coverage-with-jacoco-offline-instrumentation-in-gradle-mutlimo/60156859#60156859
Also, there is a working example: 
https://github.com/SurpSG/jacoco-offline-instrumentation

On Tuesday, February 4, 2020 at 9:40:43 PM UTC+2, Sergiy Gnatyuk wrote:
>
> I've tried to setup Jacoco(offline instrumentation) in my gradle 
> multi-module project. I have to use offline instrumentation because there 
> are multiple PowerMock tests in the project.
>
> I have two modules: A and B. Module A has tests that partially cover a 
> code from module B but such code coverage data is missed in my summary 
> report.
>
>
> My configuration based on stackoverflow answer Jacoco offline 
> instrumentation Gradle script 
> <https://stackoverflow.com/questions/41370815/jacoco-offline-instrumentation-gradle-script/42238982#42238982>
>
> I've created a test project that demonstrates the issue: 
> https://github.com/SurpSG/jacoco-offline-instrumentation
>
>
> On the other hand, when I'm using jacoco gradle plugin I can observe that 
> coverage data provided by module A for module B successfully collected to 
> a summary report. 
>
> I've created one more test project to demonstrate this: 
> https://github.com/SurpSG/jacoco-gradle-plugin-merge-coverage
>
>
> Is it a way to collect cross-module code coverage by fixing my build 
> script configuration?
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/38bdaa87-2263-4c6e-b422-677474ceec27%40googlegroups.com.

Reply via email to