aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile9
-rwxr-xr-xtest/test-client-server.sh9
2 files changed, 17 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index f45d824..2baaee8 100644
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,12 @@ else
CMAKE_BUILD_TYPE = Release
endif
+ifdef WITH_ASAN
+ CC = clang
+ CFLAGS += -fsanitize=address
+ LDFLAGS += -fsanitize=address
+endif
+
ifeq ($(VERBOSE),)
MAKEFLAGS += -s
endif
@@ -63,6 +69,8 @@ pre-push: realclean
make realclean
make test CC=clang
make test CC=clang BUILD_TYPE=rel
+ make realclean
+ make test WITH_ASAN=1
realclean:
rm -rf $(BUILD_DIR_BASE)
@@ -75,6 +83,7 @@ force_cmake: $(BUILD_DIR)/Makefile
$(BUILD_DIR)/Makefile:
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR); $(CMAKE) \
+ -D "CMAKE_C_COMPILER:STRING=$(CC)" \
-D "CMAKE_C_FLAGS:STRING=$(CFLAGS)" \
-D "CMAKE_BUILD_TYPE:STRING=$(CMAKE_BUILD_TYPE)" \
-D "CMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX)" \
diff --git a/test/test-client-server.sh b/test/test-client-server.sh
index bda91a2..866fd95 100755
--- a/test/test-client-server.sh
+++ b/test/test-client-server.sh
@@ -2,7 +2,14 @@
set -e
-valgrind="valgrind --quiet --trace-children=yes --error-exitcode=1 --leak-check=full"
+#
+# ASAN and valgrind, understandably, don't get along.
+#
+if [ "$WITH_ASAN" = 1 ]; then
+ valgrind=""
+else
+ valgrind="valgrind --quiet --trace-children=yes --error-exitcode=1 --leak-check=full"
+fi
sock="/tmp/vfio-user.sock"
rm -f ${sock}*