2012-09-02 11:37:18 +02:00
language : cpp
2014-03-17 13:23:29 +01:00
2012-09-02 11:37:18 +02:00
compiler :
2012-09-05 06:45:39 +02:00
- clang
2014-03-23 19:14:31 +01:00
- gcc
2014-03-17 13:23:29 +01:00
2014-01-04 11:37:03 +01:00
env :
global :
2015-11-10 20:44:24 +01:00
# unfortunately we need this to stay within 50min timelimit given by travis.
2014-01-04 11:37:03 +01:00
# this also turns off the debug/warning cxxflags
2015-11-10 20:44:24 +01:00
- CXXFLAGS="-O2 -march=native -mtune=native -Wunreachable-code"
2014-01-04 11:37:03 +01:00
matrix :
2014-05-27 21:27:10 +02:00
# 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
2014-05-24 10:22:59 +02:00
- CXXFLAGS="${CXXFLAGS} -DCHECK_INTERNAL"
2014-06-18 23:16:00 +02:00
- SRCDIR=build CHECK_CLANG=yes VERIFY=1
- CXXFLAGS="${CXXFLAGS} -DCHECK_INTERNAL" MAKEFLAGS="HAVE_RULES=yes" SRCDIR=build VERIFY=1
2014-03-17 13:23:29 +01:00
2014-01-17 20:46:20 +01:00
matrix :
2014-03-17 13:23:29 +01:00
# do notify immediately about it when a job of a build fails.
2014-01-17 20:46:20 +01:00
fast_finish : true
2014-05-24 10:22:59 +02:00
# exclude clang checking with clang binary, not needed
2014-03-17 13:23:29 +01:00
exclude :
- compiler : clang
2014-05-24 10:22:59 +02:00
env : SRCDIR=build CHECK_CLANG=yes VERIFY=1
2014-03-17 13:23:29 +01:00
2013-10-12 12:40:20 +02:00
before_install :
2014-01-04 11:37:03 +01:00
# install needed deps
2013-10-12 12:40:20 +02:00
- sudo apt-get update -qq
2015-08-16 18:28:25 +02:00
- sudo apt-get install -qq python-pygments libqt4-core libqt4-gui libqt4-dev qt4-dev-tools qt4-qmake libxml2-utils libpcre3 gdb unzip
2014-03-17 13:23:29 +01:00
2012-09-05 07:22:49 +02:00
script :
2014-05-24 10:22:59 +02:00
# download clang git, compile cppcheck, run cppcheck on clang code to look for crashes in cppcheck. if this is done, terminate build
2015-12-13 01:58:25 +01:00
- if [[ "$CHECK_CLANG" == "yes" ]] && [[ "$CC" == "gcc" ]]; then wget "https://github.com/llvm-mirror/clang/archive/817ee21333dffb3c77ef845aa1a9f8d1dc94a842.zip" & make -j 4 & wait; unzip 817ee21333dffb3c77ef845aa1a9f8d1dc94a842.zip > /dev/null; touch /tmp/clang.cppcheck; cd ./clang-817ee21333dffb3c77ef845aa1a9f8d1dc94a842 ; ../cppcheck . --max-configs=1 --enable=all --inconclusive --exception-handling -iINPUTS -itest/Driver/Inputs/gen-response.c -j 2 |& tee /tmp/clang.cppcheck; cd ../ ; ! grep "process crashed with signal\|Internal error\. compiled" /tmp/clang.cppcheck; exit; fi
2015-07-31 15:33:27 +02:00
# check with TEST_MATHLIB_VALUE enabled
2015-10-14 10:50:53 +02:00
- touch lib/mathlib.cpp test/testmathlib.cpp
2015-07-16 11:14:58 +02:00
- make test -j4 CPPFLAGS=-DTEST_MATHLIB_VALUE
2015-07-31 15:33:27 +02:00
- touch lib/mathlib.cpp test/testmathlib.cpp
2015-10-14 10:50:53 +02:00
# check with CPPCHECK2 enabled that disables various simplifications
- touch lib/tokenize.cpp
- make testrunner -j4 CPPFLAGS=-DCPPCHECK2
- ./testrunner TestValueFlow
- touch lib/tokenize.cpp
# compile cppcheck, default build
2014-01-04 11:37:03 +01:00
- make test -j4
# compile gui
2013-10-07 16:58:53 +02:00
- cd gui
- qmake
2014-01-04 11:37:03 +01:00
- make -j4
2014-01-12 16:30:14 +01:00
# building gui generates some more files that cppcheck can check, so check the repo *after* building gui
- cd ../
2014-05-24 10:22:59 +02:00
# 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
2014-03-18 01:58:43 +01:00
- touch /tmp/cppcheck.cppcheck
2014-06-14 12:54:18 +02:00
- ./cppcheck --error-exitcode=1 -Ilib --enable=style,performance,portability,warning,internal --exception-handling --suppressions-list=.travis_suppressions . -j 2 |& tee /tmp/cppcheck.cppcheck
2014-03-18 17:36:52 +01:00
- sh -c "! grep '^\[' /tmp/cppcheck.cppcheck"
2015-07-22 13:31:33 +02:00
# run extra tests
- tools/generate_and_run_more_tests.sh
2015-01-27 19:31:41 +01:00
# check test/cfg
- make checkcfg
2014-01-12 16:30:14 +01:00
- cd ./gui
# clean rebuild
2014-01-04 11:37:03 +01:00
- 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 ../
2014-01-04 11:37:03 +01:00
# check htmlreport stuff
2013-10-05 17:03:31 +02:00
- ./htmlreport/test_htmlreport.py
2013-10-07 16:15:21 +02:00
- cd htmlreport
2013-10-12 15:49:42 +02:00
- ./check.sh
2013-10-07 16:15:21 +02:00
- cd ../
2014-01-04 11:37:03 +01:00
# check if DESTDIR works TODO: actually execute this
2013-10-07 21:38:03 +02:00
- mkdir install_test
- make DESTDIR=install_test install
2014-01-04 11:37:03 +01:00
# 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
2013-12-31 15:20:30 +01:00
- sudo mkdir -p /usr/share/cppcheck/cfg
- sudo install -D ./cfg/* -t /usr/share/cppcheck/cfg
2014-01-04 11:37:03 +01:00
# check if it actually works:
2013-12-31 15:20:30 +01:00
- /usr/bin/cppcheck ./cli
2014-01-04 11:37:03 +01:00
# check if reduce tool compiles
2014-01-02 10:51:18 +01:00
- make reduce -j 4
2014-01-04 11:37:03 +01:00
# 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
2014-01-08 01:44:17 +01:00
# check if Makefile needs to be regenerated
- git clean -dfx
- make dmake
2015-10-07 23:52:39 +02:00
- make run-dmake
2014-01-08 01:44:17 +01:00
# now, if dmake modified the makefile, return false!
- git diff --exit-code
2014-03-17 13:23:29 +01:00
2013-02-11 19:32:53 +01:00
notifications :
irc :
channels :
- "irc.freenode.org#cppcheck"
template :
- "[%{commit} : %{author}] %{message}"
- "%{build_url}"
skip_join : true