diff --git a/scripts/generate-java-code-coverage.sh b/scripts/generate-java-code-coverage.sh index 7f90f3f5e68..0b6a01439e2 100755 --- a/scripts/generate-java-code-coverage.sh +++ b/scripts/generate-java-code-coverage.sh @@ -7,8 +7,8 @@ if [ "$(basename "$(pwd)")" != "java" ]; then exit 1 fi -# make -C ../cpp srcs -# make +make -C ../cpp srcs +make if [ ! -f org.jacoco.cli-nodeps.jar ]; then wget https://repo1.maven.org/maven2/org/jacoco/org.jacoco.cli/$JACOCO_VERSION/org.jacoco.cli-$JACOCO_VERSION-nodeps.jar -O org.jacoco.cli-nodeps.jar @@ -20,14 +20,15 @@ fi python3 allTests.py --all --workers=4 --debug --jacoco $(pwd)/org.jacoco.agent-runtime.jar -# We don't want any coverage for IceGridGUI -find src/IceGridGUI -name '*.java' -exec rm {} \; - # We don't want any coverage for generated code. We remove their class files and any inner classes. jacocoArgs=() for dir in src/*; do + # Skip non-directories. [ -d "$dir" ] || continue + # Skip IceGridGUI + [ "$(basename "$dir")" == "IceGridGUI" ] && continue + jacocoArgs+=(--classfiles "$dir/build/classes/java/main") jacocoArgs+=(--sourcefiles "$dir/src/main/java")