From: Mathieu Desnoyers Date: Thu, 24 Oct 2024 21:36:52 +0000 (-0400) Subject: Fix static checker test include dir X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=2d9b0b9be6753540dcc0225fa9c03b496ec64c9c;p=libside.git Fix static checker test include dir Now works even if libside is not installed in the system. Change-Id: Ide06e6087cce2b2658d1166f23a8cd61dc2f68af Signed-off-by: Mathieu Desnoyers --- diff --git a/tests/static-checker/run-tests b/tests/static-checker/run-tests index ab47c6d..4691a8d 100755 --- a/tests/static-checker/run-tests +++ b/tests/static-checker/run-tests @@ -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