snapraid/makesan.sh

63 lines
972 B
Bash
Raw Normal View History

#!/bin/sh
#
# Run all the Sanitizers available
#
# Compiler to use
2017-10-12 23:16:45 +02:00
COMPILER=clang
# Options for configure
# --disable-asm
# Inline assembly is not supported by the Sanitizers
# --without-blkid
# External libraries are not supported by the Sanitizers
OPTIONS="--disable-asm --without-blkid"
2017-10-27 22:43:56 +02:00
# Source directory
SOURCE=`pwd`
# Dest directory
DEST=`mktemp -d`
make distclean
2017-10-27 22:43:56 +02:00
cd $DEST
# AddressSanitizer
2017-10-27 22:43:56 +02:00
if ! $SOURCE/configure --enable-asan $OPTIONS CC=$COMPILER; then
exit 1
fi
if ! make check distclean; then
exit 1
fi
# UndefinedBehaviourSanitizer
2017-10-27 22:43:56 +02:00
if ! $SOURCE/configure --enable-ubsan $OPTIONS CC=$COMPILER; then
exit 1
fi
if ! make check distclean; then
exit 1
fi
# MemorySanitizer
2017-10-27 22:43:56 +02:00
if ! $SOURCE/configure --enable-msan $OPTIONS CC=$COMPILER; then
exit 1
fi
if ! make check distclean; then
exit 1
fi
# ThreadSanitizer
2017-10-27 22:43:56 +02:00
if ! $SOURCE/configure --enable-tsan $OPTIONS CC=$COMPILER; then
exit 1
fi
if ! make check distclean; then
exit 1
fi
2017-10-27 22:43:56 +02:00
cd $SOURCE