Let's detect ASAN LDFLAGS in top level Makefile to make sure we call
tests with --memcheck-asan if build-system has been configured with
--enable-asan.
Signed-off-by: Karel Zak <kzak@redhat.com>
top_srcdir=
top_builddir=
paraller_jobs=1
+has_asan_opt=
function num_cpus()
{
--force |\
--fake |\
--memcheck-valgrind |\
- --memcheck-asan |\
--nolocks |\
--show-diff |\
--verbose |\
# these options are simply forwarded to the test scripts
OPTS="$OPTS $1"
;;
+ --memcheck-asan)
+ OPTS="$OPTS $1"
+ has_asan_opt="yes"
+ ;;
--use-system-commands)
OPTS="$OPTS $1"
SYSCOMMANDS="yes"
OPTS="$OPTS --srcdir=$top_srcdir --builddir=$top_builddir"
+# Auto-enable ASAN to avoid conflicts between tests and binaries
+if [ -z "$has_asan_opt" ]; then
+ asan=$(awk '/^ASAN_LDFLAGS/ { print $3 }' $top_builddir/Makefile)
+ if [ -n "$asan" ]; then
+ OPTS="$OPTS --memcheck-asan"
+ fi
+fi
+
declare -a comps
if [ -n "$SUBTESTS" ]; then
# selected tests only
printf "%13s: %-30s " "kernel" "$(uname -r)"
echo
echo
+echo " options: $(echo $OPTS | sed 's/ / \\\n /g')"
+echo
if [ "$paraller_jobs" -ne 1 ]; then
tmp=$paraller_jobs