From 285efcb7196cdd994716e498e440b898bec38e0c Mon Sep 17 00:00:00 2001 From: Chris Jaekl Date: Tue, 28 Nov 2017 22:03:32 +0900 Subject: [PATCH] Bring the coverage analysis of the unit test suite back into a runnable state. It seems that my system upgrade a few weeks ago (which changed the default JVM from 8 to 9) has made jcov unhappy. I'm adding a reference to JAVA_HOME, so that I can (temporarily!) force Java 8 until I figure out what to do about jcov and Java 9. Also disabling the 2nd run (under server local locale) because jcov seems unhappy about that, too, at the moment, for reasons that remain unclear. This change should bring things back to a runnable state. --- cov.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cov.sh b/cov.sh index a9fe22c..2007b1f 100755 --- a/cov.sh +++ b/cov.sh @@ -1,11 +1,13 @@ #!/bin/bash WEB_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" INSTR_DIR="${WEB_ROOT}/../instr" +JAVA=${JAVA_HOME}/bin/java +JAVAC=${JAVA_HOME}/bin/javac ##################### echo Compiling... -find "${WEB_ROOT}/prod" -name "*.java" | xargs javac -Xlint:deprecation -find "${WEB_ROOT}/test" -name "*.java" | xargs javac -classpath ${WEB_ROOT}/prod:${CLASSPATH} -Xlint:deprecation +find "${WEB_ROOT}/prod" -name "*.java" | xargs ${JAVAC} -Xlint:deprecation +find "${WEB_ROOT}/test" -name "*.java" | xargs ${JAVAC} -classpath ${WEB_ROOT}/prod:${CLASSPATH} -Xlint:deprecation ##################### echo Cleaning old coverage files... @@ -25,7 +27,7 @@ done ##################### echo Instrumenting... -java -classpath "${CLASSPATH}" -jar `pwd`/jcov/jcov.jar Instr -t template.xml -o "${INSTR_DIR}" -type all "${WEB_ROOT}/prod" +${JAVA} -classpath "${CLASSPATH}" -jar `pwd`/jcov/jcov.jar Instr -t template.xml -o "${INSTR_DIR}" -type all "${WEB_ROOT}/prod" ##################### echo Running unit tests... @@ -40,12 +42,12 @@ do done echo First run: locale es_ES, timezone Europe/Madrid -java -Duser.language=es -Duser.country=ES -Duser.timezone=Europe/Madrid -Djcov.template=${WEB_ROOT}/template.xml -Djcov.file=${WEB_ROOT}/result.xml -classpath "${INSTR_DIR}:${WEB_ROOT}/test:${CLASSPATH}:/usr/share/java/junit.jar:${WEB_ROOT}/jcov/jcov_file_saver.jar" org.junit.runner.JUnitCore ${TESTS} +${JAVA} -Duser.language=es -Duser.country=ES -Duser.timezone=Europe/Madrid -Djcov.template=${WEB_ROOT}/template.xml -Djcov.file=${WEB_ROOT}/result.xml -classpath "${INSTR_DIR}:${WEB_ROOT}/test:${CLASSPATH}:/usr/share/java/junit.jar:${WEB_ROOT}/jcov/jcov_file_saver.jar" org.junit.runner.JUnitCore ${TESTS} -echo Second run: server default locale and timezone -java -Djcov.template=${WEB_ROOT}/template.xml -Djcov.file=${WEB_ROOT}/result.xml -classpath "${INSTR_DIR}:${WEB_ROOT}/test:${CLASSPATH}:/usr/share/java/junit.jar:${WEB_ROOT}/jcov/jcov_file_saver.jar" org.junit.runner.JUnitCore ${TESTS} +#echo Second run: server default locale and timezone +#java -Djcov.template=${WEB_ROOT}/template.xml -Djcov.file=${WEB_ROOT}/result.xml -classpath "${INSTR_DIR}:${WEB_ROOT}/test:${CLASSPATH}:/usr/share/java/junit.jar:${WEB_ROOT}/jcov/jcov_file_saver.jar" org.junit.runner.JUnitCore ${TESTS} ##################### echo Generating HTML Report... -java -jar "${WEB_ROOT}/jcov/jcov.jar" RepGen -sourcepath "${WEB_ROOT}/prod" -log.level FINE result.xml +${JAVA} -jar "${WEB_ROOT}/jcov/jcov.jar" RepGen -sourcepath "${WEB_ROOT}/prod" -log.level FINE result.xml -- 2.30.2