From 0e639ea7c972478f1ed77485ebe720bcd4983650 Mon Sep 17 00:00:00 2001 From: rikardfalkeborn Date: Sun, 15 Jul 2018 22:24:31 +0200 Subject: [PATCH] runtest.sh: Bugfix cfg dir when run in test/cfg (#1311) Commit 5cc8da2db473 introduced syntax checking of xml-files. This broke running the file directly in the test/cfg folder since it assumed the config files to check were located in cfg in the current working directory. Fix this by adding a variable that holds the correct path. --- test/cfg/runtests.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/cfg/runtests.sh b/test/cfg/runtests.sh index dc876e7a6..56e6d0b49 100755 --- a/test/cfg/runtests.sh +++ b/test/cfg/runtests.sh @@ -5,9 +5,11 @@ set -x # be verbose if [[ $(pwd) == */test/cfg ]] ; then # we are in test/cfg CPPCHECK="../../cppcheck" DIR="" + CFG="../../cfg/" else # assume we are in repo root CPPCHECK="./cppcheck" DIR=test/cfg/ + CFG="cfg/" fi # Cppcheck options @@ -109,7 +111,7 @@ set -e if [ $XMLSTARLET_RETURNCODE -ne 0 ]; then echo "xmlstarlet needed to extract defines, skipping defines check." else - for configfile in cfg/*.cfg; do + for configfile in ${CFG}*.cfg; do echo "Checking defines in $configfile" # Disable debugging output temporarily since there could be many defines set +x