From 0f2ba9e2da67bdf1546726021b2fd92cd524e367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 24 May 2014 10:22:59 +0200 Subject: [PATCH 1/5] 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. --- .travis.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index dea990c1d..2e54aee0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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" From f16524c9dd5ea2946d8e7d28b47061304611f02c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 18 Jun 2014 23:16:00 +0200 Subject: [PATCH 2/5] travis: add -DCHECK_INTERNAL to the VERIFY=1 job to automatically fetch issues like #5869 via travis, check clang with --exception-handling --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e54aee0d..e0d6b046c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,10 +11,9 @@ 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 - - SRCDIR=build CHECK_CLANG=yes VERIFY=1 - - MAKEFLAGS="HAVE_RULES=yes" SRCDIR=build VERIFY=1 - - SRCDIR=build VERIFY=1 - 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. @@ -31,7 +30,7 @@ before_install: 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/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 + - 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 --exception-handling -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 From b45bb821f2e45fb8db564781ef5e61a04a3e2024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 18 Jun 2014 23:34:00 +0200 Subject: [PATCH 3/5] travis: make clang check sensitive to internal cppcheck errors. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e0d6b046c..a1a4d692d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ before_install: 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/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 --exception-handling -iINPUTS -j 2 |& tee /tmp/clang.cppcheck; cd ../ ; ! grep "process crashed with signal" /tmp/clang.cppcheck; exit; fi + - 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 --exception-handling -iINPUTS -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 From 3c21acd1fa64a65d4f19d6df33d979b14b8baf75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Tue, 22 Jul 2014 14:50:40 +0200 Subject: [PATCH 4/5] travis: update clang repo hash --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a1a4d692d..32282f79a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ before_install: 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/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 --exception-handling -iINPUTS -j 2 |& tee /tmp/clang.cppcheck; cd ../ ; ! grep "process crashed with signal\|Internal error\. compiled" /tmp/clang.cppcheck; exit; fi + - 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 -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 From 15a197eea6ceb7bb6deaeb886ee48d43e5784739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Mon, 28 Jul 2014 17:14:01 +0200 Subject: [PATCH 5/5] travis: suppress current warnings, make cppcheck not crash the files in clang that crash currently. --- .travis.yml | 2 +- .travis_suppressions | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 32282f79a..046da9395 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ before_install: 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 -j 2 |& tee /tmp/clang.cppcheck; cd ../ ; ! grep "process crashed with signal\|Internal error\. compiled" /tmp/clang.cppcheck; exit; fi + - 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 -itest/CodeGenCXX/mangle-alias-template.cpp -itest/Lexer/unicode.c -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 diff --git a/.travis_suppressions b/.travis_suppressions index 3d3e60eb8..86a9a74f0 100644 --- a/.travis_suppressions +++ b/.travis_suppressions @@ -1,5 +1,6 @@ unusedPrivateFunction:test/testcmdlineparser.cpp redundantNextPrevious:test/testtoken.cpp +uselessAssignmentPtrArg:build/checkstl.cpp *:gui/test* *:test/test.cxx