summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2021-02-06 07:17:04 -0500
committerAllen Winter <allen.winter@kdab.com>2021-04-11 12:58:10 -0400
commit9b7581d4f88e71a0676f1fe95669759120424f5c (patch)
treeff594cbe99e461f35bd076d4dde15aa0da2fbbd7 /scripts
parentd2cf5ebdbfb13ec5f270bc2efb4581e8f6c79b9a (diff)
downloadlibical-git-9b7581d4f88e71a0676f1fe95669759120424f5c.tar.gz
scripts/buildtests.sh - bolt-on some Ninja testing
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/buildtests.sh38
1 files changed, 34 insertions, 4 deletions
diff --git a/scripts/buildtests.sh b/scripts/buildtests.sh
index 5dafb9fe..3167779a 100755
--- a/scripts/buildtests.sh
+++ b/scripts/buildtests.sh
@@ -34,6 +34,7 @@ HELP() {
echo " -t, --no-tidy Don't run any clang-tidy tests"
echo " -b, --no-scan Don't run any scan-build tests"
echo " -s, --no-splint Don't run any splint tests"
+ echo " -n, --no-ninja Don't run any build tests with ninja"
echo " -l, --no-clang-build Don't run any clang-build tests"
echo " -g, --no-gcc-build Don't run any gcc-build tests"
echo " -a, --no-asan-build Don't run any ASAN-build tests"
@@ -154,7 +155,12 @@ CLEAN() {
BUILD() {
cd $TOP
CONFIGURE "$1" "$2"
- make 2>&1 | tee make.out || exit 1
+ MAKE=make
+ if ( test `echo $2 | grep -ci Ninja` -gt 0 )
+ then
+ MAKE=ninja
+ fi
+ $MAKE 2>&1 | tee make.out || exit 1
COMPILE_WARNINGS make.out
if (test "`uname -s`" = "Darwin")
@@ -163,7 +169,7 @@ BUILD() {
else
export LD_LIBRARY_PATH=$BDIR/lib
fi
- make test 2>&1 | tee make-test.out || exit 1
+ $MAKE test 2>&1 | tee make-test.out || exit 1
CLEAN
}
@@ -185,6 +191,24 @@ GCC_BUILD() {
echo "===== END GCC BUILD: $1 ======"
}
+#function NINJA_GCC_BUILD:
+# runs a build test using gcc using the Ninja cmake generator
+# $1 = the name of the test (which will have "-ninjagcc" appended to it)
+# $2 = CMake options
+NINJA_GCC_BUILD() {
+ name="$1-ninjagcc"
+ if ( test $runninja -ne 1 )
+ then
+ echo "===== NINJA_GCC BUILD TEST $1 DISABLED DUE TO COMMAND LINE OPTION ====="
+ return
+ fi
+ COMMAND_EXISTS "gcc"
+ echo "===== START NINJA_GCC BUILD: $1 ======"
+ SET_GCC
+ BUILD "$name" "$2 -G Ninja"
+ echo "===== END NINJA_GCC BUILD: $1 ======"
+}
+
#function CLANG_BUILD:
# runs a build test using clang
# $1 = the name of the test (which will have "-clang" appended to it)
@@ -450,7 +474,7 @@ KRAZY() {
##### END FUNCTIONS #####
-#TEMP=`getopt -o hmkctbslgad --long help,no-cmake-compat,no-krazy,no-cppcheck,no-tidy,no-scan,no-splint,no-clang-build,no-gcc-build,no-asan-build,no-tsan-build -- "$@"`
+#TEMP=`getopt -o hmkctbsnlgad --long help,no-cmake-compat,no-krazy,no-cppcheck,no-tidy,no-scan,no-splint,no-ninja,no-clang-build,no-gcc-build,no-asan-build,no-tsan-build -- "$@"`
TEMP=`getopt hmkctbslgad $*`
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
# Note the quotes around `$TEMP': they are essential!
@@ -461,6 +485,7 @@ runkrazy=1
runcppcheck=1
runtidy=1
runscan=1
+runninja=1
runclangbuild=1
rungccbuild=1
runasanbuild=1
@@ -475,6 +500,7 @@ while true ; do
-t|--no-tidy) runtidy=0; shift;;
-b|--no-scan) runscan=0; shift;;
-s|--no-splint) runsplint=0; shift;;
+ -n|--non-ninja) runninja=0; shift;;
-l|--no-clang-build) runclangbuild=0; shift;;
-g|--no-gcc-build) rungccbuild=0; shift;;
-a|--no-asan-build) runasanbuild=0; shift;;
@@ -542,7 +568,11 @@ fi
GCC_BUILD testgcc1builtin "-DUSE_BUILTIN_TZDATA=True"
GCC_BUILD testgcc2builtin "$TZCMAKEOPTS"
-#Clang based build tests
+#Ninja build tests
+NINJA_GCC_BUILD testninjagcc1 ""
+NINJA_GCC_BUILD testninjagcc2 "-DSHARED_ONLY=True"
+NINJA_GCC_BUILD testninjagcc3 "-DSTATIC_ONLY=True -DICAL_GLIB=False"
+
CLANG_BUILD testclang1 ""
CLANG_BUILD testclang2 "$CMAKEOPTS"
CLANG_BUILD testclang3 "$UUCCMAKEOPTS"