summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKarel Zak2019-04-24 12:24:15 +0200
committerKarel Zak2019-04-24 12:24:15 +0200
commit0b17c997c0ae9b3268e1c2c22ca8906b2e22a5dd (patch)
tree5c1a74866068aa998b9aa63dbb8a0a7d61c54b9c /tests
parentlslogins: Fix discrepancies of SYS_UID_MIN (diff)
downloadkernel-qcow2-util-linux-0b17c997c0ae9b3268e1c2c22ca8906b2e22a5dd.tar.gz
kernel-qcow2-util-linux-0b17c997c0ae9b3268e1c2c22ca8906b2e22a5dd.tar.xz
kernel-qcow2-util-linux-0b17c997c0ae9b3268e1c2c22ca8906b2e22a5dd.zip
tests: auto-enable ASAN option if necessary
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>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/run.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/run.sh b/tests/run.sh
index 2a7133149..57faf734c 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -25,6 +25,7 @@ SYSCOMMANDS=
top_srcdir=
top_builddir=
paraller_jobs=1
+has_asan_opt=
function num_cpus()
{
@@ -60,7 +61,6 @@ while [ -n "$1" ]; do
--force |\
--fake |\
--memcheck-valgrind |\
- --memcheck-asan |\
--nolocks |\
--show-diff |\
--verbose |\
@@ -70,6 +70,10 @@ while [ -n "$1" ]; do
# 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"
@@ -145,6 +149,14 @@ fi
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
@@ -196,6 +208,8 @@ echo
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