From 4393a96e8972b059f2d8093c89ca67084efd0d98 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 14 Feb 2017 00:34:07 +0300 Subject: [PATCH] Travis CI: Add source check by Clang Static Analyzer --- .travis.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 -- 2.50.1