fixed ubsan tests with dynamic library
authorYann Collet <cyan@fb.com>
Thu, 17 Sep 2020 23:49:21 +0000 (16:49 -0700)
committerYann Collet <cyan@fb.com>
Thu, 17 Sep 2020 23:49:21 +0000 (16:49 -0700)
Makefile
tests/.gitignore

index 6bf952c..c1869f6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -124,8 +124,8 @@ check:
 
 .PHONY: test
 test:
-       CFLAGS="$(CFLAGS)" $(MAKE) -C $(TESTDIR) $@
-       CFLAGS="$(CFLAGS)" $(MAKE) -C $(EXDIR) $@
+       CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) -C $(TESTDIR) $@
+       CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) -C $(EXDIR) $@
 
 clangtest: CFLAGS ?= -O3
 clangtest: CFLAGS += -Werror -Wconversion -Wno-sign-conversion
@@ -142,8 +142,11 @@ clangtest-native: clean
        @CFLAGS="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE) -C $(PRGDIR)  native CC=clang
        @CFLAGS="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE) -C $(TESTDIR) native CC=clang
 
+usan: CC      = clang
+usan: CFLAGS  = -O3 -g -fsanitize=undefined -fno-sanitize-recover=undefined -fsanitize-recover=pointer-overflow
+usan: LDFLAGS = $(CFLAGS)
 usan: clean
-       CC=clang CFLAGS="-O3 -g -fsanitize=undefined -fno-sanitize-recover=undefined -fsanitize-recover=pointer-overflow" $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1
+       CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1
 
 usan32: clean
        CFLAGS="-m32 -O3 -g -fsanitize=undefined" $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1
index 0d13df8..99351af 100644 (file)
@@ -11,6 +11,7 @@ fasttest
 roundTripTest
 checkTag
 checkFrame
+decompress-partial
 
 # test artefacts
 tmp*