diff --git a/scripts/test.sh b/scripts/test.sh index 93b5dcc65..b9ff3b4de 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -232,18 +232,13 @@ test_java() fi # calculate number of all run tests from ant output log file - local JAVA_VERSION=`${JAVA_BIN} -version 2>&1 | grep version | cut -d'"' -f2 | cut -d'.' -f1` - local JAVA_MAJOR_VERSION=${JAVA_VERSION%.*} - if [[ "{JAVA_MAJOR_VERSION}" != "1."* ]] ; then - JAVA_MAJOR_VERSION=${JAVA_MAJOR_VERSION%.*} - fi + local JAVA_VERSION=`${ANT} -diagnostics | grep ant.java.version | cut -d' ' -f2` local ANT_LOG_FILE="${TEST_OUT_DIR}/java/${JAVA_VERSION}/test_log.txt" if [ ! -f "${ANT_LOG_FILE}" ] ; then stderr_echo "Ant output file '${ANT_LOG_FILE}' does not exist!" return 1 fi local TEST_COUNTS=(`grep '.*tests found.*' "${ANT_LOG_FILE}" | tr -s ' ' | cut -d' ' -f4`) - local TOTAL_TEST_COUNT=0 local INDEX for INDEX in ${!TEST_COUNTS[@]} ; do TOTAL_TEST_COUNT=$((${TOTAL_TEST_COUNT} + ${TEST_COUNTS[INDEX]}))