From c773e6ed10293c0a54cb2031b54ba48e143f5d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 23 Jan 2019 09:40:43 +0100 Subject: [PATCH] runtests.sh: uncomment the xmlstarlet checking --- test/cfg/runtests.sh | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/test/cfg/runtests.sh b/test/cfg/runtests.sh index e5baf2ce4..a44c759fc 100755 --- a/test/cfg/runtests.sh +++ b/test/cfg/runtests.sh @@ -169,23 +169,24 @@ ${CPPCHECK} ${CPPCHECK_OPT_CHECK_LIB} --inconclusive --library=boost ${DIR}boost ${CPPCHECK} ${CPPCHECK_OPT} --inconclusive --library=boost ${DIR}boost.cpp # Check the syntax of the defines in the configuration files -# FIXME: This is temporarily commented out, xmllint is preferred -#set +e -#xmlstarlet --version -#XMLSTARLET_RETURNCODE=$? -#set -e -#if [ $XMLSTARLET_RETURNCODE -ne 0 ]; then -# echo "xmlstarlet needed to extract defines, skipping defines check." -#else -# for configfile in ${CFG}*.cfg; do -# echo "Checking defines in $configfile" -# # Disable debugging output temporarily since there could be many defines -# set +x -# # XMLStarlet returns 1 if no elements were found which is no problem here -# set +e -# EXTRACTED_DEFINES=$(xmlstarlet sel -t -m '//define' -c . -n <$configfile) -# set -e -# EXTRACTED_DEFINES=$(echo "$EXTRACTED_DEFINES" | sed 's///g') -# echo "$EXTRACTED_DEFINES" | gcc -fsyntax-only -xc -Werror - -# done -#fi +set +e +xmlstarlet --version +XMLSTARLET_RETURNCODE=$? +set -e +if [ $XMLSTARLET_RETURNCODE -ne 0 ]; then + echo "xmlstarlet needed to extract defines, skipping defines check." +else + for configfile in ${CFG}*.cfg; do + echo "Checking defines in $configfile" + # Disable debugging output temporarily since there could be many defines + set +x + # XMLStarlet returns 1 if no elements were found which is no problem here + set +e + EXTRACTED_DEFINES=$(xmlstarlet sel -t -m '//define' -c . -n <$configfile) + set -e + EXTRACTED_DEFINES=$(echo "$EXTRACTED_DEFINES" | sed 's///g') + echo "$EXTRACTED_DEFINES" | gcc -fsyntax-only -xc -Werror - + done +fi + +echo SUCCESS