RFR: Add build support for generating Jacoco coverage reports [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Dec 5 10:19:04 UTC 2023


On Mon, 4 Dec 2023 22:06:16 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Add a new `coverage` gradle task that can be used to generate a Jacoco test coverage report. Because we're on the bleeding edge, the user running the build needs to build Jacoco from source for this to work. Though, this is optional.
>> 
>> As an example: I've cloned Jacoco from here: https://github.com/jacoco/jacoco and built the project using:
>> 
>>     mvn package -DskipTests -Dbytecode.version=22
>>     
>> Then, I point gradle at the generated artifacts using:
>> 
>>     jacoco_cli=<jacoco repo>/org.jacoco.cli/target/org.jacoco.cli-0.8.12-SNAPSHOT-nodeps.jar
>>     jacoco_agent=<jacoco repo>/org.jacoco.agent/target/classes/jacocoagent.jar
>>     
>> I've put these in a local `gradle.properties` file instead of passing them on the command line.
>> 
>> I then run `./gradlew coverage` which generates an html coverage report under `./build/jacoco-report`.
>
> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
> 
>   lazily configure coverage task

Marked as reviewed by mcimadamore (Committer).

-------------

PR Review: https://git.openjdk.org/jextract/pull/153#pullrequestreview-1764648678


More information about the jextract-dev mailing list