TT#111150 add top-level make target for asan test

This is a convenient shortcut to also run these tests locally.

Change-Id: Ifb1355319b7eebd708acddea6e0fc7fa2c7dcdfb
pull/1292/head^2
Richard Fuchs 5 years ago
parent 46a3f7a3ac
commit 1d845c2103

@ -11,9 +11,6 @@ jobs:
runs-on: ubuntu-latest
name: Run unit tests
env:
FLAGS: "-ggdb -O0 -fsanitize=address -fsanitize=leak -fsanitize=undefined"
steps:
- name: Checkout source
uses: actions/checkout@v2
@ -28,4 +25,4 @@ jobs:
- name: Run unit tests with sanitizers enabled
run: |
CFLAGS="$FLAGS" LDFLAGS="$FLAGS" ASAN_OPTIONS=verify_asan_link_order=0 UBSAN_OPTIONS=print_stacktrace=1 G_SLICE=always-malloc make check
make asan-check

@ -1,6 +1,18 @@
RTPENGINE_ROOT_DIR=.
with_transcoding ?= yes
ifeq ($(DO_ASAN_FLAGS),1)
ASAN_FLAGS = -ggdb -O0 -fsanitize=address -fsanitize=leak -fsanitize=undefined
CFLAGS ?= -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wstrict-prototypes
CFLAGS += $(ASAN_FLAGS)
LDFLAGS += $(ASAN_FLAGS)
export CFLAGS
export LDFLAGS
export ASAN_OPTIONS=verify_asan_link_order=0
export UBSAN_OPTIONS=print_stacktrace=1
export G_SLICE=always-malloc
endif
include lib/lib.Makefile
.PHONY: all distclean clean coverity
@ -36,7 +48,10 @@ distclean clean:
$(MAKE) -C iptables-extension $@
$(MAKE) -C kernel-module $@
.PHONY: check
.PHONY: check asan-check
check: all
$(MAKE) -C t
asan-check:
DO_ASAN_FLAGS=1 $(MAKE) check

Loading…
Cancel
Save