From b0baf4f65b4fb2124c253f3c06bfae8b318bb465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 30 Apr 2019 08:56:20 +0200 Subject: [PATCH] Travis: Fix the cppcheck self-check --- .travis.yml | 6 +++--- .travis_suppressions | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 80ecb7b74..24b779fd9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -218,12 +218,12 @@ script: - make -s -j2 # 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 +# self check - touch /tmp/cppcheck.cppcheck - - ${CPPCHECK} --template=gcc -D__CPPCHECK__ -f --error-exitcode=1 --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml/ -Icli --enable=style,performance,portability,warning,internal --exception-handling --inline-suppr --suppressions-list=.travis_suppressions -itest/synthetic -iaddons -igui . -j 2 |& tee /tmp/cppcheck.cppcheck + - ${CPPCHECK} --template=gcc -D__CPPCHECK__ -f --error-exitcode=1 --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml/ -Icli --enable=style,performance,portability,warning,internal --exception-handling --inline-suppr --suppressions-list=.travis_suppressions -itest/cli -itest/synthetic -itest/testsuites -iaddons -igui . -j 2 |& tee /tmp/cppcheck.cppcheck # check gui with qt settings - ${CPPCHECK} --template=gcc --library=qt --error-exitcode=1 -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml/ -Icli --enable=style,performance,portability,warning,internal --exception-handling -j 2 gui --suppressions-list=.travis_suppressions -igui/test |& tee --append /tmp/cppcheck.cppcheck - - sh -c "! grep '^\[' /tmp/cppcheck.cppcheck" + - sh -c "! grep '\]$' /tmp/cppcheck.cppcheck" # check naming conventions - ${CPPCHECK} -i gui/test -j 2 --dump -q gui lib - find lib gui -maxdepth 1 -name "*.dump" | xargs -n 1 -P 4 python addons/naming.py --private-member-variable='m[A-Z].*' diff --git a/.travis_suppressions b/.travis_suppressions index 5e3a69702..e66190296 100644 --- a/.travis_suppressions +++ b/.travis_suppressions @@ -3,11 +3,16 @@ unusedPrivateFunction:test/testcmdlineparser.cpp redundantNextPrevious:test/testtoken.cpp simplePatternError:test/testtoken.cpp noValidConfiguration -useStlAlgorithm shadowFunction -# temporarily suppress missingOverride +# temporary suppressions - fix the warnings! missingOverride +shadowVar +shiftTooManyBitsSigned +uninitStructMember +unsignedLessThanZero +unusedPrivateFunction +useStlAlgorithm *:gui/test/* *:test/test.cxx