From 24c011d4a61c889b2ee3c955318a874c75b6864b Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Tue, 2 Aug 2022 14:45:18 +0200 Subject: [PATCH] test: catch definite leaks with valgrind --- test/compilation/003-sanitizers | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/compilation/003-sanitizers b/test/compilation/003-sanitizers index 2cf5258..8040efe 100755 --- a/test/compilation/003-sanitizers +++ b/test/compilation/003-sanitizers @@ -2,6 +2,8 @@ # Run the unit and simulation tests with different compiler sanitizers # and under valgrind +valgrind_opts="--leak-check=full --errors-for-leak-kinds=definite" + cd ../.. if [ "$(uname -sm)" != "Linux x86_64" ]; then @@ -75,7 +77,7 @@ do pushd test/unit || exit 1 make "$@" || exit 1 if [ "$san_options" = "" ]; then - make check TEST_WRAPPER="valgrind --error-exitcode=1" || exit 1 + make check TEST_WRAPPER="valgrind $valgrind_opts --error-exitcode=1" || exit 1 else make check || exit 1 fi @@ -87,7 +89,7 @@ do pushd test/simulation || exit 1 export CLKNETSIM_RANDOM_SEED=101 if [ "$arch_opts" = "" -a "$san_options" = "" ]; then - CLKNETSIM_CLIENT_WRAPPER=valgrind ./run -i 1 || exit 1 + CLKNETSIM_CLIENT_WRAPPER="valgrind $valgrind_opts" ./run -i 1 || exit 1 elif [ "$CC" = "gcc" ] && ! echo $CFLAGS | grep -q "-static-libasan"; then libasan=$(ldd ../../chronyd | grep -o '/.*lib.*/libasan.so.[0-9]') CLKNETSIM_PRELOAD=$libasan ./run -i 1 || exit 1