Enhance Jacoco coverage summary output to include module name and improve readability with additional separators.

This commit is contained in:
2025-07-03 14:48:52 -05:00
parent 04e64b04ab
commit fc6f7b084d

View File

@ -247,7 +247,7 @@ if [ ! -e target/site/jacoco/index.html ]; then
fi fi
echo echo
echo "Jacoco coverage summary report:" echo "Jacoco coverage summary report for module: ${project.artifactId}"
echo " See also target/site/jacoco/index.html" echo " See also target/site/jacoco/index.html"
echo " and https://www.jacoco.org/jacoco/trunk/doc/counters.html" echo " and https://www.jacoco.org/jacoco/trunk/doc/counters.html"
echo "------------------------------------------------------------" echo "------------------------------------------------------------"
@ -261,11 +261,14 @@ if [ -f target/site/jacoco/index.html ]; then
else else
echo "Jacoco coverage summary was not found."; echo "Jacoco coverage summary was not found.";
fi fi
echo "-----------------------------"
echo
echo "Untested classes, per Jacoco:" echo "Untested classes, per Jacoco for module: ${project.artifactId}"
echo "-----------------------------" echo "-----------------------------"
# Parse Jacoco XML reports directly to find classes with 0% coverage # Parse Jacoco XML reports directly to find classes with 0% coverage
sed 's/<classs .*\?>/&\n/g;s/<\/class>/&\n/g' target/site/jacoco/jacoco.xml | grep -v 'counter type="CLASS" missed="0"' | sed 's/>.*//;s/.*\///;s/".*//' sed 's/<classs .*\?>/&\n/g;s/<\/class>/&\n/g' target/site/jacoco/jacoco.xml | grep -v 'counter type="CLASS" missed="0"' | sed 's/>.*//;s/.*\///;s/".*//'
echo "-----------------------------"
echo echo
]]> ]]>