From 3663fd5ae5d7256a13feeb5ef7465f35bfe8eb2f Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 14 Feb 2017 13:28:56 +0300 Subject: [PATCH] Travis CI: Add source check by Clang Static Analyzer --- .travis.yml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6c28ed0..e30adcd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ env: - CONF_STATIC=--disable-static CONF_THREADS=--disable-threads CFLAGS_EXTRA="-O3 -march=native" + - CSA_CHECK=true matrix: exclude: @@ -32,6 +33,8 @@ matrix: env: CONF_GC_DEBUG=--disable-gc-debug - compiler: gcc env: CONF_LARGE_CONFIG=--enable-large-config + - compiler: clang + env: CSA_CHECK=true sudo: required @@ -55,10 +58,31 @@ install: - ./autogen.sh script: - - ./configure $CONF_ASSERTIONS $CONF_CPP $CONF_GCOV $CONF_GC_DEBUG + - if [[ "$CSA_CHECK" != true ]]; then + ./configure $CONF_ASSERTIONS $CONF_CPP $CONF_GCOV $CONF_GC_DEBUG $CONF_LARGE_CONFIG $CONF_M_UNMAP $CONF_SHARED - $CONF_SINGLE_OBJ $CONF_STATIC $CONF_THREADS --enable-werror - - make -j check CFLAGS_EXTRA="$CFLAGS_EXTRA $CFLAGS_EXTRA_M" + $CONF_SINGLE_OBJ $CONF_STATIC $CONF_THREADS --enable-werror; + - if [[ "$CSA_CHECK" != true ]]; then + make -j check CFLAGS_EXTRA="$CFLAGS_EXTRA $CFLAGS_EXTRA_M"; + fi + - if [[ "$CSA_CHECK" == true ]]; then + clang --analyze -Xanalyzer -analyzer-output=text + -m32 -Werror -I include -I libatomic_ops/src + *.c *.cc cord/*.c cord/tests/cordtest.c cord/tests/de.c extra/gc.c + extra/msvc_dbg.c tests/*.c tests/*.cc tools/*.c && + clang --analyze -Xanalyzer -analyzer-output=text + -Werror -I include -I libatomic_ops/src + -D ALL_INTERIOR_POINTERS -D CHECKSUMS -D DBG_HDRS_ALL + -D DEBUG_THREADS -D ENABLE_TRACE -D GC_ALWAYS_MULTITHREADED + -D GC_ASSERTIONS -D GC_ATOMIC_UNCOLLECTABLE + -D GC_ENABLE_SUSPEND_THREAD -D GC_GCJ_SUPPORT + -D GC_PRINT_BACK_HEIGHT -D GC_THREADS -D HANDLE_FORK + -D JAVA_FINALIZATION -DK EEP_BACK_PTRS -D MAKE_BACK_GRAPH + -D PARALLEL_MARK -D PRINT_BLACK_LIST -D THREAD_LOCAL_ALLOC + -D USE_MMAP -D USE_MUNMAP + *.c *.cc cord/*.c cord/tests/cordtest.c cord/tests/de.c extra/gc.c + extra/msvc_dbg.c tests/*.c tests/*.cc tools/*.c; + fi after_success: - if [[ "$CONF_GCOV" == --en* ]]; then -- 2.7.4