Fix static checker test include dir
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 24 Oct 2024 21:36:52 +0000 (17:36 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 24 Oct 2024 21:36:52 +0000 (17:36 -0400)
Now works even if libside is not installed in the system.

Change-Id: Ide06e6087cce2b2658d1166f23a8cd61dc2f68af
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/static-checker/run-tests

index ab47c6dae9de0c4a088c27e4988f7f2943afb4c6..4691a8d0cfe6f50c6d33b132d8044718d463ca28 100755 (executable)
@@ -2,7 +2,7 @@
 
 CURDIR=$(dirname "$0")/
 TESTDIR=$CURDIR/..
-SRCDIR=$CURDIR/../..
+SRCINCLUDEDIR=$SIDE_TESTS_SRCDIR/../include
 
 SH_TAP=1
 source "$TESTDIR/utils/utils.sh"
@@ -17,18 +17,18 @@ HAVE_CLANG=$(($? == 0))
 
 function run_test() {
        if [ $HAVE_GCC -eq 1 ]; then
-               cat prologue.c "$1" | gcc -I "$SRCDIR/include" -xc /dev/stdin -o /dev/null 2>&1 | grep --quiet -E "$2"
+               cat prologue.c "$1" | gcc -I "$SRCINCLUDEDIR" -xc /dev/stdin -o /dev/null 2>&1 | grep --quiet -E "$2"
                ok $? "gcc $1"
-               cat prologue.c "$1" | gcc -I "$SRCDIR/include" -xc++ /dev/stdin -o /dev/null 2>&1 | grep --quiet -E "$2"
+               cat prologue.c "$1" | gcc -I "$SRCINCLUDEDIR" -xc++ /dev/stdin -o /dev/null 2>&1 | grep --quiet -E "$2"
                ok $? "g++ $1"
        else
                skip 0 "gcc not present" 2
        fi
 
        if [ $HAVE_CLANG -eq 1 ]; then
-               cat prologue.c "$1" | clang -I "$SRCDIR/include" -xc /dev/stdin -o /dev/null 2>&1 | grep --quiet -E "$2"
+               cat prologue.c "$1" | clang -I "$SRCINCLUDEDIR" -xc /dev/stdin -o /dev/null 2>&1 | grep --quiet -E "$2"
                ok $? "clang $1"
-               cat prologue.c "$1" | clang -I "$SRCDIR/include" -xc++ /dev/stdin -o /dev/null 2>&1 | grep --quiet -E "$2"
+               cat prologue.c "$1" | clang -I "$SRCINCLUDEDIR" -xc++ /dev/stdin -o /dev/null 2>&1 | grep --quiet -E "$2"
                ok $? "clang++ $1"
        else
                skip 0 "clang not present" 2
This page took 0.024246 seconds and 4 git commands to generate.