I am very new to this environment. I came from a native iOS background.
By using this https://blog.gouline.net/code-coverage-on-android-with-jacoco-92ec90c9355e, I am successfully generating the JACOCO
test reports for my unit test class in my android project (app module only).
What I am doing is:
- I simply create
jacoco.gradle
file in the main project. - Apply from:
'../jacoco.gradle'
inapp/build.gradle
file Added below code in the
app/build.gradle
fileandroid { ... buildTypes { debug { testCoverageEnabled = true } ... } ... }
Open a terminal inside the Android Studio and run the command like
**gradlew tasks**
To generate a report, run the command
**gradlew testBlueDebugUnitTestCoverage**
Finally I found my reports at this path:
\app\build\reports\tests\testTabletDebugUnitTest
By using this http://vgaidarji.me/blog/2017/12/20/how-to-configure-jacoco-for-kotlin-and-java-project/ I have successfully generated the jacoco report for the both Espresso and Coverage test classes (UI and Unit Testing), and also this project includes both java & kotlin classes.
Now my question is: I want to generate the jacoco
test reports for specific module out of all other modules in my app.
System Info:
Windows 10,
Android Studio 3.3.1,
Kotlin: ext.kotlin_version = '1.3.21'
Gradle:gradle:3.4.0-alpha01.