jacoco.exec generated in a unexpected place if a testcase uses classes from other module

33 views
Skip to first unread message

denis...@gmail.com

unread,
Mar 1, 2018, 6:53:44 AM3/1/18
to JaCoCo and EclEmma Users
In a multi module project, when I write testcases which use classes from other module, somehow gradle plugin generates `jacoco.exec` in app directory.
And in `app/build/jacoco/testDebugUnitTest.exec` also exists.

I have found a temporary workaround. Just specify the system property:
testOptions {
unitTests {
all {
systemProperty 'jacoco-agent.destfile', buildDir.path + '/jacoco/tests.exec'
}
}
}

or add a file jacoco-agent.properties file with destfile=build/jacoco/tests.exec content in the library project under debug/resources/ folder.

My reproducible project: https://github.com/DenysShovhenia/Test
Steps to reproduce:
- Open project in Android Studio
- Run testDebugUnitTest task of Test(root) module
- Note the newly created jacoco.exec file in the root folder of app module

Gradle version: 4.1.0
Android Plugin Version: 3.0.1
Module Compile Sdk Version: 26


Also, I have found a similar open issue here: https://issuetracker.google.com/issues/67872367

denis...@gmail.com

unread,
Mar 1, 2018, 7:19:00 AM3/1/18
to JaCoCo and EclEmma Users
Also after running gradlew app:dependencies command console showed Jacoco version 0.7.4.201502262128.


androidJacocoAgent - The Jacoco agent to use to get coverage data.
\--- org.jacoco:org.jacoco.agent:0.7.4.201502262128

androidJacocoAnt - The Jacoco ant tasks to use to get execute Gradle tasks.
\--- org.jacoco:org.jacoco.ant:0.7.4.201502262128
+--- org.jacoco:org.jacoco.core:0.7.4.201502262128
| \--- org.ow2.asm:asm-debug-all:5.0.1
+--- org.jacoco:org.jacoco.report:0.7.4.201502262128
| +--- org.jacoco:org.jacoco.core:0.7.4.201502262128 (*)
| \--- org.ow2.asm:asm-debug-all:5.0.1
\--- org.jacoco:org.jacoco.agent:0.7.4.201502262128

Marc Hoffmann

unread,
Mar 1, 2018, 7:27:00 AM3/1/18
to jac...@googlegroups.com
Hi,

the JaCoCo integration is maintained directly at the Gradle project.
Please contact them for questions (https://discuss.gradle.org/).

Regards,
-marc

denis...@gmail.com

unread,
Mar 1, 2018, 7:40:45 AM3/1/18
to JaCoCo and EclEmma Users
четверг, 1 марта 2018 г., 14:27:00 UTC+2 пользователь Marc R. Hoffmann написал:
> Hi,
>
> the JaCoCo integration is maintained directly at the Gradle project.
> Please contact them for questions (https://discuss.gradle.org/).
>
> Regards,
> -marc
>

Ok.

I have already asked them my question, but no one answered yet.
(https://discuss.gradle.org/t/after-upgrading-to-the-gradle-3-0-1-version-jacoco-plugin-generates-redundant-jacoco-exec-file/25995)
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages