Commit 492cd954 authored by Kamil Godzwon's avatar Kamil Godzwon Committed by Tomasz Zawadzki
Browse files

valgrind: fixed ASAN/Valgrind options



Patch for not running tests if ASAN and
Valgrind options are both enabled.

Fixes #2422

Signed-off-by: default avatarKamil Godzwon <kamilx.godzwon@intel.com>
Change-Id: I50c91bede687f0aee571c1f2540530a7fafcb49c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11998


Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent a6eafd95
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -347,10 +347,6 @@ function unittest_build() {
	$MAKE $MAKEFLAGS
}

if [ $SPDK_RUN_VALGRIND -eq 1 ]; then
	run_test "valgrind" echo "using valgrind"
fi

if [ $SPDK_RUN_ASAN -eq 1 ]; then
	run_test "asan" echo "using asan"
fi
+13 −0
Original line number Diff line number Diff line
@@ -137,6 +137,11 @@ function unittest_init() {
	$valgrind $testdir/lib/init/subsystem.c/subsystem_ut
}

if [ $SPDK_RUN_VALGRIND -eq 1 ] && [ $SPDK_RUN_ASAN -eq 1 ]; then
	echo "ERR: Tests cannot be run if both SPDK_RUN_VALGRIND and SPDK_RUN_ASAN options are selected simultaneously"
	exit 1
fi

# if ASAN is enabled, use it.  If not use valgrind if installed but allow
# the env variable to override the default shown below.
if [ -z ${valgrind+x} ]; then
@@ -146,6 +151,14 @@ if [ -z ${valgrind+x} ]; then
		valgrind=''
	fi
fi
if [ $SPDK_RUN_VALGRIND -eq 1 ]; then
	if [ -n "$valgrind" ]; then
		run_test "valgrind" echo "Using valgrind for unit tests"
	else
		echo "ERR: SPDK_RUN_VALGRIND option is enabled but valgrind is not available"
		exit 1
	fi
fi

# setup local unit test coverage if cov is available
# lcov takes considerable time to process clang coverage.