[vala/wip/ci: 2/9] build: Add --enable-asan configure option




commit 9b5ed3178e32c24cc336822cd9fd46eebb04c613
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Feb 4 14:19:57 2021 +0100

    build: Add --enable-asan configure option
    
    List XFAIL tests if address sanatizer is enabled

 configure.ac      | 8 ++++++++
 tests/Makefile.am | 8 ++++++++
 2 files changed, 16 insertions(+)
---
diff --git a/configure.ac b/configure.ac
index 66cbd52a3..2f74431b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -114,6 +114,14 @@ AC_SUBST(COVERAGE_VALAFLAGS)
 AC_SUBST(COVERAGE_CFLAGS)
 AC_SUBST(COVERAGE_LIBS)
 
+AC_ARG_ENABLE(asan, AS_HELP_STRING([--enable-asan], [Enable Address Sanitizer analysis]), 
enable_asan=$enableval, enable_asan=no)
+AM_CONDITIONAL(ENABLE_ASAN, test x$enable_asan = xyes)
+
+if test "$enable_asan" = "yes"; then
+       CFLAGS="$CFLAGS -fsanitize=address -fno-omit-frame-pointer"
+       LDFLAGS="$LDFLAGS -fsanitize=address -fno-omit-frame-pointer"
+fi
+
 
 # Check supported compiler flags used in testrunner.sh
 TEST_EXTRA_CFLAGS="-Werror=init-self \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b8b15b2cf..bc3b64a5c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1184,6 +1184,14 @@ LINUX_TESTS += \
        $(NULL)
 endif
 
+if ENABLE_ASAN
+XFAIL_TESTS = \
+       objects/property-array.vala \
+       dbus/errors.test \
+       dbus/filedescriptor-errors.test \
+       $(NULL)
+endif
+
 EXTRA_DIST = \
        gtktemplate/tests-extra-environment.sh \
        linux/tests-extra-environment.sh \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]