Enable address sanitizer for tests.

Submitted by Suraev on Jan. 20, 2016, 3:57 p.m.

Details

Message ID 1453305464-21916-1-git-send-email-suraev@alumni.ntnu.no
State New
Headers show

Commit Message

Suraev Jan. 20, 2016, 3:57 p.m.
From: Max <msuraev@sysmocom.de>

Some tests are leaky which is ok since it's one-shot programs
anyway. For them mem. leak sanitizer is explicitly disabled via
env. variables.

Sponsored-by: On-Waves ehf
---
 tests/Makefile.am  |  4 ++--
 tests/testsuite.at | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/Makefile.am b/tests/Makefile.am
index a4a6b2e..082f449 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,6 @@ 
 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
-AM_CFLAGS = -Wall $(TALLOC_CFLAGS)
-AM_LDFLAGS = $(TALLOC_LIBS)
+AM_CFLAGS = -Wall $(TALLOC_CFLAGS) -ggdb3 -Og -fsanitize=address -fno-omit-frame-pointer
+AM_LDFLAGS = $(TALLOC_LIBS) -fsanitize=address
 
 check_PROGRAMS = timer/timer_test sms/sms_test ussd/ussd_test		\
                  smscb/smscb_test bits/bitrev_test a5/a5_test		\
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 9cda1de..32defa3 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -1,6 +1,6 @@ 
 AT_INIT
 AT_BANNER([Regression tests.])
-
+AT_COLOR_TESTS
 
 # todo.. create one macro for it
 AT_SETUP([a5])
@@ -44,7 +44,7 @@  AT_SETUP([msgfile])
 AT_KEYWORDS([msgfile])
 cp $abs_srcdir/msgfile/msgconfig.cfg .
 cat $abs_srcdir/msgfile/msgfile_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/msgfile/msgfile_test], [0], [expout])
+AT_CHECK([ASAN_OPTIONS="detect_leaks=0" $abs_top_builddir/tests/msgfile/msgfile_test], [0], [expout])
 AT_CLEANUP
 endif
 
@@ -81,13 +81,13 @@  AT_CLEANUP
 AT_SETUP([lapd])
 AT_KEYWORDS([lapd])
 cat $abs_srcdir/lapd/lapd_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/lapd/lapd_test], [0], [expout], [ignore])
+AT_CHECK([ASAN_OPTIONS="detect_leaks=0" $abs_top_builddir/tests/lapd/lapd_test], [0], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([gsm0808])
 AT_KEYWORDS([gsm0808])
 cat $abs_srcdir/gsm0808/gsm0808_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/gsm0808/gsm0808_test], [0], [expout], [ignore])
+AT_CHECK([ASAN_OPTIONS="detect_leaks=0" $abs_top_builddir/tests/gsm0808/gsm0808_test], [0], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([gsm0408])
@@ -164,7 +164,7 @@  AT_SETUP([bssgp-fc])
 AT_KEYWORDS([bssgp-fc])
 cat $abs_srcdir/gb/bssgp_fc_tests.ok > expout
 cat $abs_srcdir/gb/bssgp_fc_tests.err > experr
-AT_CHECK([$abs_top_srcdir/tests/gb/bssgp_fc_tests.sh $abs_top_builddir/tests/gb], [0], [expout], [experr])
+AT_CHECK([ASAN_OPTIONS="detect_leaks=0" $abs_top_srcdir/tests/gb/bssgp_fc_tests.sh $abs_top_builddir/tests/gb], [0], [expout], [experr])
 AT_CLEANUP
 
 AT_SETUP([timer])