From 57a1df44a492e2525893ff23400c575964240e0f Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Fri, 27 Oct 2017 22:43:56 +0200 Subject: [PATCH] Add support for sanitizers --- configure.ac | 4 ++-- makesan.sh | 20 +++++++++++++++----- maketest.sh | 20 +++++++++++++++----- 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 356469b1..64861143 100644 --- a/configure.ac +++ b/configure.ac @@ -258,7 +258,7 @@ AC_ARG_ENABLE([sgcheck], AC_ARG_ENABLE([helgrind], [AS_HELP_STRING([--enable-helgrind],[enable the use of helgrind in testing])], [ - TESTENV="$VALGRIND --tool=helgrind --fair-sched=try --suppressions=valgrind.supp --error-exitcode=1" + TESTENV="$VALGRIND --tool=helgrind --fair-sched=try --error-exitcode=1" FAILENV="$TESTENV" CFLAGS="$CFLAGS -DCHECKER" THREAD_CHECKER=1 @@ -268,7 +268,7 @@ AC_ARG_ENABLE([helgrind], AC_ARG_ENABLE([drd], [AS_HELP_STRING([--enable-drd],[enable the use of drd in testing])], [ - TESTENV="$VALGRIND --tool=drd --fair-sched=try --suppressions=valgrind.supp --error-exitcode=1" + TESTENV="$VALGRIND --tool=drd --fair-sched=try --error-exitcode=1" FAILENV="$TESTENV" CFLAGS="$CFLAGS -DCHECKER" THREAD_CHECKER=1 diff --git a/makesan.sh b/makesan.sh index 860ec65c..d2686538 100755 --- a/makesan.sh +++ b/makesan.sh @@ -13,10 +13,18 @@ COMPILER=clang # External libraries are not supported by the Sanitizers OPTIONS="--disable-asm --without-blkid" +# Source directory +SOURCE=`pwd` + +# Dest directory +DEST=`mktemp -d` + make distclean +cd $DEST + # AddressSanitizer -if ! ./configure --enable-asan $OPTIONS CC=$COMPILER; then +if ! $SOURCE/configure --enable-asan $OPTIONS CC=$COMPILER; then exit 1 fi @@ -25,7 +33,7 @@ if ! make check distclean; then fi # UndefinedBehaviourSanitizer -if ! ./configure --enable-ubsan $OPTIONS CC=$COMPILER; then +if ! $SOURCE/configure --enable-ubsan $OPTIONS CC=$COMPILER; then exit 1 fi @@ -34,7 +42,7 @@ if ! make check distclean; then fi # MemorySanitizer -if ! ./configure --enable-msan $OPTIONS CC=$COMPILER; then +if ! $SOURCE/configure --enable-msan $OPTIONS CC=$COMPILER; then exit 1 fi @@ -43,7 +51,7 @@ if ! make check distclean; then fi # ThreadSanitizer -if ! ./configure --enable-tsan $OPTIONS CC=$COMPILER; then +if ! $SOURCE/configure --enable-tsan $OPTIONS CC=$COMPILER; then exit 1 fi @@ -51,7 +59,9 @@ if ! make check distclean; then exit 1 fi -if ! ./configure ; then +cd $SOURCE + +if ! ./configure; then exit 1 fi diff --git a/maketest.sh b/maketest.sh index 75c746cf..0c5c18cc 100755 --- a/maketest.sh +++ b/maketest.sh @@ -3,10 +3,18 @@ # Run all the Coverage and Valgrind tests # +# Source directory +SOURCE=`pwd` + +# Dest directory +DEST=`mktemp -d` + make distclean +cd $DEST + # Coverage -if ! ./configure --enable-coverage --enable-sde; then +if ! $SOURCE/configure --enable-coverage --enable-sde; then exit 1 fi @@ -19,7 +27,7 @@ if ! make distclean; then fi # Valgrind -if ! ./configure --enable-valgrind; then +if ! $SOURCE/configure --enable-valgrind; then exit 1 fi @@ -28,7 +36,7 @@ if ! make check distclean; then fi # Helgrind -if ! ./configure --enable-helgrind; then +if ! $SOURCE/configure --enable-helgrind; then exit 1 fi @@ -37,7 +45,7 @@ if ! make check distclean; then fi # Drd -if ! ./configure --enable-drd; then +if ! $SOURCE/configure --enable-drd; then exit 1 fi @@ -45,7 +53,9 @@ if ! make check distclean; then exit 1 fi -if ! ./configure ; then +cd $SOURCE + +if ! ./configure; then exit 1 fi