There are 2 bugs in the jacoco_report_converter.py in which the src_file
and src_path are redefined and overwritten in the loop. These bugs cause
both of them to empty after the first iteration. This makes the
resulting JSON report summary only contain the first filename to
process. This has been mentioned in #11966.
This PR proposes a fix by changing the name of the needed variables.
Also, this PR adds in a filter to exclude fuzzer classes in the coverage
information as they are not part of the projects. The updated script
will include the coverage information for each class that existed in the
project source directory (`/out/src`) in the summary tag of the
resulting summary.json report.
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
* Exclude Jazzer classes from coverage reports
* Generate file-level coverage data for Java
Adds per-file coverage information to llvm-cov style *.json files for
Java targets.
This provides full CI Fuzz support for "jvm" projects.
Coverage is collected by running the fuzz targets with the JaCoCo agent
in Jazzer's no instrumentation mode.
Since JaCoCo does not support llvm-cov style coverage reports, a simple
Python helper creates it using the information contained in the JaCoCo
XML report.
As the Java build process does not maintain a mapping between source
files and build artifacts and JaCoCo needs to be passed the root folder
of the package tree, we use the Maven directory layout convention to
heuristically detect these roots.