From d4b43989f117c51c33a215ae1b5b06533d6f279b Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Tue, 12 Jan 2016 23:08:57 -0800 Subject: CI: add clang-analyzer build on travis. --- .travis.yml | 11 +++++++++++ travis.sh | 10 +++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d44156a..178de61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,9 @@ matrix: - compiler: clang os: linux env: CONFIG=tsan + - compiler: clang + os: linux + env: CONFIG=scan-build - compiler: clang os: osx env: CONFIG=cmake @@ -49,8 +52,16 @@ script: addons: apt: + # List of whitelisted in travis packages for ubuntu-precise can be found here: + # https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise + # List of whitelisted in travis apt-sources: + # https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.7 packages: - libpopt-dev + - clang-3.7 coverity_scan: project: diff --git a/travis.sh b/travis.sh index f5c67c6..2d9ef6c 100755 --- a/travis.sh +++ b/travis.sh @@ -29,8 +29,16 @@ build_tsan() { ctest -V . } +build_scan-build() { + mkdir $PWD/_build && cd $PWD/_build + scan-build-3.7 cmake .. -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$PWD/../_install \ + -DCMAKE_C_FLAGS="-Werror" + scan-build-3.7 make install +} + if [ "$#" -ne 1 ]; then - echo "Usage: $0 {autotools|cmake|asan|tsan}" + echo "Usage: $0 {autotools|cmake|asan|tsan|scan-build}" exit 1 fi -- cgit v1.2.1