cppcheck/.travis.yml

96 lines
3.8 KiB
YAML
Raw Normal View History

2012-09-02 11:37:18 +02:00
language: cpp
2012-09-02 11:37:18 +02:00
compiler:
2012-09-05 06:45:39 +02:00
- clang
- gcc
env:
global:
# unfortunately we need this to stay within 50min timelimit given by travis.
# this also turns off the debug/warning cxxflags
- 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
- CXXFLAGS="${CXXFLAGS} -DCHECK_INTERNAL" MAKEFLAGS="HAVE_RULES=yes" SRCDIR=build VERIFY=1
matrix:
# do notify immediately about it when a job of a build fails.
fast_finish: true
# exclude clang checking with clang binary, not needed
exclude:
- compiler: clang
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 unzip
script:
# 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/0d9772d6c4fd0f69f7bdbb692768f07f9af2a3d0.zip" & make -j 4 & wait; unzip 0d9772d6c4fd0f69f7bdbb692768f07f9af2a3d0.zip > /dev/null; touch /tmp/clang.cppcheck; cd ./clang-0d9772d6c4fd0f69f7bdbb692768f07f9af2a3d0 ; ../cppcheck . --max-configs=1 --enable=all --inconclusive --exception-handling -iINPUTS -itest/CXX/temp/temp.decls/temp.mem/p5.cpp -j 2 |& tee /tmp/clang.cppcheck; cd ../ ; ! grep "process crashed with signal\|Internal error\. compiled" /tmp/clang.cppcheck; exit; fi
# compile cppcheck, default build
- make -j4
- make test -j4
# compile gui
2013-10-07 16:58:53 +02:00
- cd gui
- qmake
- 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 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"
- cd ./gui
# clean rebuild
- git clean -dfx .
# can't set this as env flags, so try again with HAVE_RULES=yes
- qmake HAVE_RULES=yes
- make -j4
2013-10-07 16:58:53 +02:00
- cd ../
# check htmlreport stuff
- ./htmlreport/test_htmlreport.py
- cd htmlreport
- ./check.sh
- cd ../
# check if DESTDIR works TODO: actually execute this
2013-10-07 21:38:03 +02:00
- mkdir install_test
- make DESTDIR=install_test install
# rm everything
- git clean -dfx
# check what happens if we want to install it to some other dir,
- make SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg -j 4
- sudo make SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg install
- sudo mkdir -p /usr/share/cppcheck/cfg
- sudo install -D ./cfg/* -t /usr/share/cppcheck/cfg
# check if it actually works:
- /usr/bin/cppcheck ./cli
# check if reduce tool compiles
2014-01-02 10:51:18 +01:00
- make reduce -j 4
# check if showtime=top5 works
- ./tools/test_showtimetop5.sh
2014-01-07 06:41:27 +01:00
# check the files in cgf dir with xmllint
- xmllint --noout cfg/*
2014-05-25 14:49:38 +02:00
# check matchcompiler
- ./tools/test_matchcompiler.py
2014-07-14 20:17:40 +02:00
# check --dump
- ./cppcheck test/testpreprocessor.cpp --dump
- xmllint --noout test/testpreprocessor.cpp.dump
# check if Makefile needs to be regenerated
- git clean -dfx
- make dmake
# now, if dmake modified the makefile, return false!
- git diff --exit-code
2013-02-11 19:32:53 +01:00
notifications:
irc:
channels:
- "irc.freenode.org#cppcheck"
template:
- "[%{commit} : %{author}] %{message}"
- "%{build_url}"
skip_join: true