travis: replace kernel check with clang check.

Check clang instead of kernel, which is a lot faster.
Make clang check failure fatal to the build.
This commit is contained in:
Matthias Krüger 2014-05-24 10:22:59 +02:00
parent 8a1c5d6fce
commit 0f2ba9e2da
1 changed files with 9 additions and 11 deletions

View File

@ -11,29 +11,27 @@ env:
- CXXFLAGS="-O2 -march=native -mtune=native -Wunreachable-code"
matrix:
# special CXXFLAGS for maximum speed, overrides global CXXFLAGS, CHECK_CLANG is the var that controls if we download and check clang in that travis job
- CXXFLAGS="${CXXFLAGS} -DCHECK_INTERNAL"
- SRCDIR=build CHECK_CLANG=yes VERIFY=1
- MAKEFLAGS="HAVE_RULES=yes" SRCDIR=build VERIFY=1
- SRCDIR=build CHECK_KERNEL=yes
- SRCDIR=build VERIFY=1
- CXXFLAGS="${CXXFLAGS} -DCHECK_INTERNAL"
matrix:
# do notify immediately about it when a job of a build fails.
fast_finish: true
# exclude kernel checking with clang binary, not needed
# exclude clang checking with clang binary, not needed
exclude:
- compiler: clang
env: SRCDIR=build CHECK_KERNEL=yes
# kernel check can time out during travis rush hour, so make failure of it less grave...
allow_failures:
- env: SRCDIR=build CHECK_KERNEL=yes
env: SRCDIR=build CHECK_CLANG=yes VERIFY=1
before_install:
# install needed deps
- sudo apt-get update -qq
- sudo apt-get install -qq python-pygments libqt4-core libqt4-gui libqt4-dev qt4-dev-tools qt4-qmake libxml2-utils libpcre3 gdb
- sudo apt-get install -qq python-pygments libqt4-core libqt4-gui libqt4-dev qt4-dev-tools qt4-qmake libxml2-utils libpcre3 gdb unzip
script:
# download 3.14-rc6 kernel, compile cppcheck, run cppcheck on the kernel to look for crashes in cppcheck. if this is done, terminate build to prevent it from timing out
- if [[ "$CHECK_KERNEL" == "yes" ]] && [[ "$CC" == "gcc" ]]; then wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.tar.xz; mkdir kernel; tar -xJf linux-3.14.tar.xz -C kernel & make -j 4 & wait; touch /tmp/kernel.cppcheck; ./cppcheck kernel --max-configs=1 --exception-handling -j 2 |& tee /tmp/kernel.cppcheck; ! grep "process crashed with signal" /tmp/kernel.cppcheck; exit; fi
# download clang git, compile cppcheck, run cppcheck on clang code to look for crashes in cppcheck. if this is done, terminate build
- if [[ "$CHECK_CLANG" == "yes" ]] && [[ "$CC" == "gcc" ]]; then wget "https://github.com/llvm-mirror/clang/archive/0ddd258c374240c22a53e3e71200048ec3a64284.zip" & make -j 4 & wait; unzip 0ddd258c374240c22a53e3e71200048ec3a64284.zip > /dev/null; touch /tmp/clang.cppcheck; cd ./clang-0ddd258c374240c22a53e3e71200048ec3a64284 ; ../cppcheck . --max-configs=1 --enable=all --inconclusive -iINPUTS -j 2 |& tee /tmp/clang.cppcheck; cd ../ ; ! grep "process crashed with signal" /tmp/clang.cppcheck; exit; fi
# compile cppcheck, default build
- make -j4
- make test -j4
@ -43,7 +41,7 @@ script:
- make -j4
# building gui generates some more files that cppcheck can check, so check the repo *after* building gui
- cd ../
# use same hack as for kernel to work around cppchecks broken exit status with -j 2 ; create file, tee everything to the file and stdout, grep for errors in the file
# use same hack as for clang to work around cppchecks broken exit status with -j 2 ; create file, tee everything to the file and stdout, grep for errors in the file
- touch /tmp/cppcheck.cppcheck
- ./cppcheck --error-exitcode=1 -Ilib --enable=style,performance,portability,warning,internal --exception-handling --suppressions-list=.travis_suppressions . -j 2 |& tee /tmp/cppcheck.cppcheck
- sh -c "! grep '^\[' /tmp/cppcheck.cppcheck"