Skip to content

Commit

Permalink
Add travis jobs for scan-build on osx and linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
padenot committed Jul 29, 2016
1 parent e407413 commit a8b016f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ matrix:
os: linux
- compiler: clang
os: osx
- compiler: clang
env: SCAN_BUILD=true
os: linux
- compiler: gcc
env: COMPILER_CXX=g++-4.8 COMPILER_CC=gcc-4.8
env: SCAN_BUILD=true
os: linux
- compiler: clang
env: SCAN_BUILD=true
os: osx
exclude:
- os: osx
compiler: gcc
Expand All @@ -21,6 +31,13 @@ matrix:
env:

before_install:
- if [[ -n $SCAN_BUILD ]]; then
if [[ $TRAVIS_OS_NAME = "osx" ]]; then
. scan-build-install.sh;
else
export SCAN_BUILD_PATH=scan-build;
fi
fi
- if [[ $TRAVIS_OS_NAME = "linux" ]]; then
sudo apt-get update -qq;
fi
Expand Down Expand Up @@ -50,9 +67,10 @@ before_script:
fi
fi
- autoreconf -i
- ./configure --host=$HOST
- $SCAN_BUILD_PATH ./configure --host=$HOST
script:
- make
- echo $SCAN_BUILD_PATH
- $SCAN_BUILD_PATH make
- if [ -z "$HOST" ]; then
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
make check;
Expand Down
16 changes: 16 additions & 0 deletions scan-build-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh -x

CLANG_CHECKER_NAME=checker-278

cd ~

if [ ! -d checker-278 ]
then
curl http://clang-analyzer.llvm.org/downloads/checker-278.tar.bz2 -o ~/$CLANG_CHECKER_NAME.tar.bz2
tar -xf ~/$CLANG_CHECKER_NAME.tar.bz2
fi

export SCAN_BUILD_PATH=~/$CLANG_CHECKER_NAME/bin/scan-build
export PATH=$PATH:$SCAN_BUILD_PATH/bin

cd -

0 comments on commit a8b016f

Please sign in to comment.