How to generate jacoco.exec file using Gradle plugin in Android Studio?

I have already read several articles related to this , this and this , but I could not find the answer. Using the Gradle plugin in Android Studio, I cannot generate the jacoco.exec file (nor * .exec in any subfolder).

What do I need to install in the build.gradle file to generate this file?

Note. Remember that I use the Gradle plugin (which is different) and Android Studio.

+5
source share
1 answer

By default, the Gradle connectedInstrumentTest task generates test reports in .ec ( Emma ) format. If you need a jacoco.exec report file, you need Robolectric + JUnit tests instead of Android unit tests (based on InstrumentationTestCase ). Here is a sample configuration of the JaCoCo Gradle plugin.

+5
source

Source: https://habr.com/ru/post/1203171/


All Articles