From 1a9c3f66db4de81d0f564893bf529318b78998be Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Mon, 26 Nov 2018 18:57:43 -0800 Subject: [PATCH] Enable config=sanitize in Travis CI This commit changes sanitize configuration to fail on the first error and ignore floating-point division and overflow "errors" that trigger when we test the corresponding functionality. This makes it possible to run this on all commits - if new UB or memory safety issues are introduced, asan/ubsan will catch them. --- .travis.yml | 1 + Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 34df9e7..3bea06d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ env: - DEFINES=PUGIXML_NO_EXCEPTIONS script: - make test cxxstd=c++11 defines=$DEFINES config=coverage -j2 + - if [[ "$CXX" == "clang++" ]]; then make test cxxstd=c++11 defines=$DEFINES config=sanitize -j2; fi - make test cxxstd=c++11 defines=$DEFINES config=release -j2 - make test cxxstd=c++98 defines=$DEFINES config=debug -j2 diff --git a/Makefile b/Makefile index e94181b..3d176d1 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ ifeq ($(config),coverage) endif ifeq ($(config),sanitize) - CXXFLAGS+=-fsanitize=address,undefined + CXXFLAGS+=-fsanitize=address,undefined -fno-sanitize=float-divide-by-zero,float-cast-overflow -fno-sanitize-recover=all LDFLAGS+=-fsanitize=address,undefined endif