summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2022-10-05 12:24:03 -0400
committerAllen Winter <allen.winter@kdab.com>2022-10-05 12:24:03 -0400
commite0f51ab24b2dccb6420602df887bbcefd8adfa60 (patch)
tree4b74e1cb182c2b2cdef5abf8c39b539576bf5ef9
parentab3c5b8abbfe6510b0f38a2bb64577f84359c2c7 (diff)
downloadlibical-git-e0f51ab24b2dccb6420602df887bbcefd8adfa60.tar.gz
scripts/buildtests.sh - minor usage improvements
-rwxr-xr-xscripts/buildtests.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/scripts/buildtests.sh b/scripts/buildtests.sh
index 22824940..a940576c 100755
--- a/scripts/buildtests.sh
+++ b/scripts/buildtests.sh
@@ -46,7 +46,11 @@ COMMAND_EXISTS () {
command -v $1 >/dev/null 2>&1
if ( test $? != 0 )
then
- echo "$1 is not in your PATH. Either install this program or skip the assocatied test"
+ echo "$1 is not in your PATH. Either install this program or skip the associated test"
+ if ( test "$2" )
+ then
+ echo "or disable this check by passing the $2 command-line option"
+ fi
exit 1
fi
}
@@ -277,7 +281,7 @@ CPPCHECK() {
echo "===== CPPCHECK TEST $1 DISABLED DUE TO COMMAND LINE OPTION ====="
return
fi
- COMMAND_EXISTS "cppcheck"
+ COMMAND_EXISTS "cppcheck" "-c"
echo "===== START SETUP FOR CPPCHECK: $1 ======"
#first build it
@@ -335,7 +339,7 @@ SPLINT() {
echo "===== SPLINT TEST $1 DISABLED DUE TO COMMAND LINE OPTION ====="
return
fi
- COMMAND_EXISTS "splint"
+ COMMAND_EXISTS "splint" "-s"
echo "===== START SETUP FOR SPLINT: $1 ======"
#first build it
@@ -420,7 +424,7 @@ CLANGTIDY() {
echo "===== CLANG-TIDY TEST $1 DISABLED DUE TO COMMAND LINE OPTION ====="
return
fi
- COMMAND_EXISTS "clang-tidy"
+ COMMAND_EXISTS "clang-tidy" "-t"
echo "===== START CLANG-TIDY: $1 ====="
cd $TOP
SET_CLANG
@@ -441,7 +445,7 @@ CLANGSCAN() {
echo "===== SCAN-BUILD TEST $1 DISABLED DUE TO COMMAND LINE OPTION ====="
return
fi
- COMMAND_EXISTS "scan-build"
+ COMMAND_EXISTS "scan-build" "-b"
echo "===== START SCAN-BUILD: $1 ====="
cd $TOP
@@ -466,7 +470,7 @@ KRAZY() {
echo "===== KRAZY TEST DISABLED DUE TO COMMAND LINE OPTION ====="
return
fi
- COMMAND_EXISTS "krazy2all"
+ COMMAND_EXISTS "krazy2all" "-k"
echo "===== START KRAZY ====="
cd $TOP
krazy2all 2>&1 | tee krazy.out
@@ -534,7 +538,7 @@ then
exit 1
fi
# read the min required CMake version from the top-level CMake file
- minCMakeVers=`grep -i cmake_minimum_required $TOP/CMakeLists.txt | grep VERSION | sed 's/^.*VERSION\s*//' | cut -d. -f1-2 | sed 's/\s*).*$//'`
+ minCMakeVers=`grep -i cmake_minimum_required $TOP/CMakeLists.txt | grep VERSION | sed 's/^.*VERSION\s*//' | cut -d. -f1-2 | sed 's/\s*).*$//' | awk '{print $NF}'`
# adjust PATH
X=`echo $minCMakeVers | cut -d. -f1`
Y=`echo $minCMakeVers | cut -d. -f2`