From: Ivan Maidanski Date: Mon, 13 Feb 2017 21:34:07 +0000 (+0300) Subject: Travis CI: Add source check by Clang Static Analyzer X-Git-Tag: v7.6.0~91 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4393a96e8972b059f2d8093c89ca67084efd0d98;p=libatomic_ops Travis CI: Add source check by Clang Static Analyzer --- diff --git a/.travis.yml b/.travis.yml index 9ad49bd..08fd70c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ env: CFLAGS_EXTRA="-march=native" CONF_ASSERTIONS=--enable-assertions - CONF_GCOV=--enable-gcov + - CSA_CHECK=true matrix: exclude: @@ -23,6 +24,8 @@ matrix: compiler: gcc - compiler: clang env: CONF_GCOV=--enable-gcov + - compiler: clang + env: CSA_CHECK=true sudo: required @@ -42,8 +45,16 @@ install: script: - ./configure $CONF_ASSERTIONS $CONF_GCOV $CONF_SHARED --enable-werror - - make -j check CFLAGS_EXTRA="$CFLAGS_EXTRA $CFLAGS_EXTRA_M" + - if [[ "$CSA_CHECK" == true ]]; then + make --directory tests list_atomic.c test_atomic_include.h; + else + make -j check CFLAGS_EXTRA="$CFLAGS_EXTRA $CFLAGS_EXTRA_M"; + fi - if [ -f tests/test_atomic.log ]; then cat tests/test_atomic*.log; fi + - if [[ "$CSA_CHECK" == true ]]; then + clang --analyze -Xanalyzer -analyzer-output=text -Werror -I src + -DAO_TRACE_MALLOC -DVERBOSE tests/*.c src/*.c; + fi after_success: - if [[ "$CONF_GCOV" == --en* ]]; then