[3/3] ci: run unit tests with ASAN
Checks
Commit Message
Enable ASAN for clang jobs.
This can greatly help identify leaks and buffer overflows.
This patch is more a fyi, as some unit tests stil have issues.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
.ci/linux-build.sh | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
@@ -79,7 +79,14 @@ fi
OPTS="$OPTS -Dmachine=default"
OPTS="$OPTS --default-library=$DEF_LIB"
-OPTS="$OPTS --buildtype=debugoptimized"
+
+if [ "$CC" != "${CC%%clang}" ] && [ "$RUN_TESTS" = 'true' ]; then
+ # Let's run tests with ASAN
+ OPTS="$OPTS -Db_sanitize=address -Db_lundef=false --buildtype=debug"
+else
+ OPTS="$OPTS --buildtype=debugoptimized"
+fi
+
OPTS="$OPTS -Dcheck_includes=true"
meson build --werror $OPTS
ninja -C build