runtests.sh: uncomment the xmlstarlet checking

This commit is contained in:
Daniel Marjamäki 2019-01-23 09:40:43 +01:00
parent 8356ec6774
commit c773e6ed10
1 changed files with 21 additions and 20 deletions

View File

@ -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/<define name="/#define /g' | sed 's/" value="/ /g' | 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/<define name="/#define /g' | sed 's/" value="/ /g' | sed 's/"\/>//g')
echo "$EXTRACTED_DEFINES" | gcc -fsyntax-only -xc -Werror -
done
fi
echo SUCCESS