From: Alan T. DeKok Date: Sun, 18 Apr 2021 13:42:12 +0000 (-0400) Subject: add ASAN / LSAN options as appropriate X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c836256b6d5425c22f7a00e493559cf2bac407e2;p=thirdparty%2Ffreeradius-server.git add ASAN / LSAN options as appropriate so that "make test" on OSX doesn't have endless complaints about leaks in libc --- diff --git a/src/tests/all.mk b/src/tests/all.mk index 319e6cd185e..4c600481375 100644 --- a/src/tests/all.mk +++ b/src/tests/all.mk @@ -83,6 +83,20 @@ ci-test: raddb/test.conf test # Or, if we're trying to clean things up. # ifneq "$(findstring test,$(MAKECMDGOALS))$(findstring clean,$(MAKECMDGOALS))" "" + +# +# Add LSAN / ASAN options. And shut them up on OSX, which has leaks in libc. +# +ifneq "$(findstring leak,$(CFLAGS))" "" +export ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) +export ASAN_OPTIONS="malloc_context_size=50 detect_leaks=1 symbolize=1" +ifneq "$(findstring apple,$(AC_HOSTINFO))" "" +export LSAN_OPTIONS=print_suppressions=0 fast_unwind_on_malloc=0 suppressions=${top_srcdir}/scripts/build/lsan_leaks_osx +else +export LSAN_OPTIONS=print_suppressions=0 fast_unwind_on_malloc=0 +endif +endif + SUBMAKEFILES := rbmonkey.mk $(subst src/tests/,,$(wildcard src/tests/*/all.mk)) endif diff --git a/src/tests/unit/all.mk b/src/tests/unit/all.mk index f3e31ee6e0d..e98ed2edf5d 100644 --- a/src/tests/unit/all.mk +++ b/src/tests/unit/all.mk @@ -53,10 +53,6 @@ $(foreach x,$(PROTOCOLS),$(eval $(call UNIT_TEST_PROTOCOLS,$x))) # This is useful, too test.unit.condition: $(addprefix $(OUTPUT)/,$(filter condition/%.txt,$(FILES))) $(BUILD_DIR)/lib/libfreeradius-server.la -#export ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) -#export ASAN_OPTIONS=malloc_context_size=50 detect_leaks=1 symbolize=1 -#export LSAN_OPTIONS=print_suppressions=0 fast_unwind_on_malloc=0 - # # And the actual script to run each test. #