You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jacoco setup for calculating kotlin test coverage (single module)
Jacoco setup for calculating kotlin test coverage (single module)
put the jacoco.gradle file below somewhere in your app repo (like scripts folder), and then add apply from: '../scripts/jacoco.gradle' to your module gradle file.
This will add additional gradle build tasks to your app, in the form of "testFlavourUnitTestCoverage" that you can run manually (e.g. testStagingDebugUnitTestCoverage) to generate the coverage.
You can edit def excludes definition to further exclude classes you don't want to generate the coverage for. If you have source in other folders beyond those specified in def coverageSourceDirs, add them.
This will generate both exec file used by external code quality analyzers (like Sonarqube), in the build/jacoco folder, and XML and HTML reports, in the build/reports/jacoco/flavourName folder.