From 8651400c1e6d8afe98f932bab6ade539d6bc4e4d Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 3 Mar 2017 18:24:43 +0300 Subject: [PATCH] Travis CI: Also test with Unexpected behavior sanitizer (UBSan) --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7414568..8278b1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,8 @@ env: - CSA_CHECK=true CFLAGS_EXTRA_M=-m32 - CPPCHECK=ALL_EXCEPT_UNUSED - CPPCHECK=UNUSED_FUNC + - SANITIZE=undefined CONF_M_UNMAP=--enable-munmap +# TODO: Add testing with ASan/MSan when clang-3.8 available. matrix: exclude: @@ -39,6 +41,10 @@ matrix: env: CPPCHECK=ALL_EXCEPT_UNUSED - compiler: clang env: CPPCHECK=UNUSED_FUNC + - compiler: gcc + env: SANITIZE=undefined CONF_M_UNMAP=--enable-munmap + - os: osx + env: SANITIZE=undefined CONF_M_UNMAP=--enable-munmap sudo: required @@ -67,6 +73,9 @@ before_install: CPPCHECK_ENABLE="--enable=unusedFunction"; fi; fi + - if [[ "$SANITIZE" != "" ]]; then + CFLAGS_EXTRA="$CFLAGS_EXTRA -fsanitize=$SANITIZE -fno-common -fno-omit-frame-pointer"; + fi install: - git clone --depth=50 https://github.com/ivmai/libatomic_ops.git @@ -106,6 +115,9 @@ script: *.cc cord/*.c cord/tests/*.c extra/*.c extra/*.cpp tests/*.c tests/*.cc tools/*.c; fi + - if [[ "$SANITIZE" == *memory* || "$SANITIZE" == *undefined* ]]; then + UBSAN_OPTIONS="halt_on_error=1" make check-without-test-driver; + fi after_success: - if [[ "$CONF_GCOV" == --en* ]]; then -- 2.7.4