From f627a26a7b1c3619ba66f84b87092ff8ba7a95b6 Mon Sep 17 00:00:00 2001 From: iphydf Date: Tue, 17 Jul 2018 01:18:04 +0000 Subject: Run Clang global static analysis on Travis. This uses a single .cc file containing almost all the code in the repository to perform whole program analysis. --- .travis/cmake-linux | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to '.travis/cmake-linux') diff --git a/.travis/cmake-linux b/.travis/cmake-linux index 48b72925..bbfb7a96 100755 --- a/.travis/cmake-linux +++ b/.travis/cmake-linux @@ -37,6 +37,13 @@ travis_install() { } } +run_static_analysis() { + export CPPFLAGS="-isystem $CACHEDIR/include" + export LDFLAGS="-L $CACHEDIR/lib" + other/analysis/run-clang + other/analysis/run-clang-analyze +} + travis_script() { . ".travis/flags-$CC.sh" @@ -50,6 +57,9 @@ travis_script() { other/astyle/format-source . "$ASTYLE" + # Use () to run in a separate process so the exports are local. + (run_static_analysis) + cmake -B_build -H. \ -DCMAKE_C_FLAGS="$C_FLAGS" \ -DCMAKE_CXX_FLAGS="$CXX_FLAGS" \ -- cgit v1.2.3