Clean up redundant actions in travis jobs (#1563)
* Clean up redundant actions in travis jobs. * Drop validatePlatforms from Makefile target checkcfg * Print out CPU count. Adjust parameters for parallel jobs to 2 - the current result.
This commit is contained in:
parent
394af25100
commit
cc4ca7525a
30
.travis.yml
30
.travis.yml
|
@ -43,10 +43,12 @@ before_install:
|
||||||
script:
|
script:
|
||||||
# fail the entire job as soon as one of the subcommands exits non-zero to save time and resources
|
# fail the entire job as soon as one of the subcommands exits non-zero to save time and resources
|
||||||
- set -e
|
- set -e
|
||||||
|
# Determine CPU count. As of January 2019 it seems to be 2 - so use this for job count in suitable calls to make or cppcheck
|
||||||
|
- cat /proc/cpuinfo
|
||||||
# download clang git, compile cppcheck, run cppcheck on clang code to look for crashes in cppcheck. if this is done, terminate build
|
# 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" == "clang" ]]; then wget "https://github.com/llvm-mirror/clang/archive/a1f8bd3778cc5a53236a53500c6ab184e945eefa.zip" & make -j 4 & wait; unzip a1f8bd3778cc5a53236a53500c6ab184e945eefa.zip > /dev/null; touch /tmp/clang.cppcheck; cd ./clang-a1f8bd3778cc5a53236a53500c6ab184e945eefa ; ${CPPCHECK} . --max-configs=1 --enable=all --inconclusive --exception-handling --template="{callstack} ({severity}) {message} [{id}]" -iINPUTS -itest/Driver/Inputs/gen-response.c -itest/Index/index-many-logical-ops.c -itest/Sema/many-logical-ops.c --suppressions-list=../.travis_llvmcheck_suppressions -j 2 |& grep -v ".* files checked.*done" |& tee /tmp/clang.cppcheck; cd ../ ; echo "CLANG" ; ! grep "process crashed with signal\|Internal error\. compiled" /tmp/clang.cppcheck; exit; fi
|
- if [[ "$CHECK_CLANG" == "yes" ]] && [[ "$CC" == "clang" ]]; then wget "https://github.com/llvm-mirror/clang/archive/a1f8bd3778cc5a53236a53500c6ab184e945eefa.zip" & make -j 2 & wait; unzip a1f8bd3778cc5a53236a53500c6ab184e945eefa.zip > /dev/null; touch /tmp/clang.cppcheck; cd ./clang-a1f8bd3778cc5a53236a53500c6ab184e945eefa ; ${CPPCHECK} . --max-configs=1 --enable=all --inconclusive --exception-handling --template="{callstack} ({severity}) {message} [{id}]" -iINPUTS -itest/Driver/Inputs/gen-response.c -itest/Index/index-many-logical-ops.c -itest/Sema/many-logical-ops.c --suppressions-list=../.travis_llvmcheck_suppressions -j 2 |& grep -v ".* files checked.*done" |& tee /tmp/clang.cppcheck; cd ../ ; echo "CLANG" ; ! grep "process crashed with signal\|Internal error\. compiled" /tmp/clang.cppcheck; exit; fi
|
||||||
# check llvm as well
|
# check llvm as well
|
||||||
- if [[ "$CHECK_LLVM" == "yes" ]] && [[ "$CC" == "clang" ]]; then wget "https://github.com/llvm-mirror/llvm/archive/6fa6453210fa34c1c28bd73a431d04734549f0d6.zip" & make -j 4 & wait; unzip 6fa6453210fa34c1c28bd73a431d04734549f0d6.zip > /dev/null; touch /tmp/llvm.cppcheck; cd ./llvm-6fa6453210fa34c1c28bd73a431d04734549f0d6 ; ${CPPCHECK} . --max-configs=1 --enable=all --inconclusive --exception-handling --template="{callstack} ({severity}) {message} [{id}]" --suppressions-list=../.travis_llvmcheck_suppressions -j 2 |& grep -v ".* files checked.*done" |& tee /tmp/llvm.cppcheck; cd ../ ; echo "LLVM" ; ! grep "process crashed with signal\|Internal error\. compiled" /tmp/llvm.cppcheck; exit; fi
|
- if [[ "$CHECK_LLVM" == "yes" ]] && [[ "$CC" == "clang" ]]; then wget "https://github.com/llvm-mirror/llvm/archive/6fa6453210fa34c1c28bd73a431d04734549f0d6.zip" & make -j 2 & wait; unzip 6fa6453210fa34c1c28bd73a431d04734549f0d6.zip > /dev/null; touch /tmp/llvm.cppcheck; cd ./llvm-6fa6453210fa34c1c28bd73a431d04734549f0d6 ; ${CPPCHECK} . --max-configs=1 --enable=all --inconclusive --exception-handling --template="{callstack} ({severity}) {message} [{id}]" --suppressions-list=../.travis_llvmcheck_suppressions -j 2 |& grep -v ".* files checked.*done" |& tee /tmp/llvm.cppcheck; cd ../ ; echo "LLVM" ; ! grep "process crashed with signal\|Internal error\. compiled" /tmp/llvm.cppcheck; exit; fi
|
||||||
# check if dmake needs to be rerun but if yes, don't fail the build but notify us.
|
# check if dmake needs to be rerun but if yes, don't fail the build but notify us.
|
||||||
# to update dmake: "make dmake; ./dmake; and commit
|
# to update dmake: "make dmake; ./dmake; and commit
|
||||||
- echo "If the following command fails, run 'make dmake; make run-dmake' and commit the resulting change."
|
- echo "If the following command fails, run 'make dmake; make run-dmake' and commit the resulting change."
|
||||||
|
@ -54,16 +56,16 @@ script:
|
||||||
# check with TEST_MATHLIB_VALUE enabled
|
# check with TEST_MATHLIB_VALUE enabled
|
||||||
- touch lib/mathlib.cpp test/testmathlib.cpp
|
- touch lib/mathlib.cpp test/testmathlib.cpp
|
||||||
- echo $CXXFLAGS
|
- echo $CXXFLAGS
|
||||||
- make -s test -j4 CPPFLAGS=-DTEST_MATHLIB_VALUE
|
- make -s test -j2 CPPFLAGS=-DTEST_MATHLIB_VALUE
|
||||||
- touch lib/mathlib.cpp test/testmathlib.cpp
|
- touch lib/mathlib.cpp test/testmathlib.cpp
|
||||||
# compile cppcheck, default build
|
# compile cppcheck, default build
|
||||||
- echo $CXXFLAGS
|
- echo $CXXFLAGS
|
||||||
- make -s test -j4
|
- make -s test -j2
|
||||||
# compile gui
|
# compile gui
|
||||||
- cd gui
|
- cd gui
|
||||||
- qmake
|
- qmake
|
||||||
- echo $CXXFLAGS
|
- echo $CXXFLAGS
|
||||||
- make -s -j4
|
- make -s -j2
|
||||||
# building gui generates some more files that cppcheck can check, so check the repo *after* building gui
|
# building gui generates some more files that cppcheck can check, so check the repo *after* building gui
|
||||||
- cd ../
|
- 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
|
# 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
|
||||||
|
@ -77,22 +79,22 @@ script:
|
||||||
- find lib gui -maxdepth 1 -name "*.dump" | xargs -n 1 -P 4 python addons/naming.py --private-member-variable='m[A-Z].*'
|
- find lib gui -maxdepth 1 -name "*.dump" | xargs -n 1 -P 4 python addons/naming.py --private-member-variable='m[A-Z].*'
|
||||||
# run extra tests
|
# run extra tests
|
||||||
- tools/generate_and_run_more_tests.sh
|
- tools/generate_and_run_more_tests.sh
|
||||||
# Validate XML
|
|
||||||
# - make validateXML doesn't work in this context unfortunately
|
|
||||||
- ${CPPCHECK} --errorlist >/tmp/errorlist.xml
|
|
||||||
- xmllint --noout --relaxng cppcheck-errors.rng /tmp/errorlist.xml
|
|
||||||
# check for missing CWE entries
|
# check for missing CWE entries
|
||||||
- make checkCWEEntries
|
- make checkCWEEntries
|
||||||
# check test/cfg
|
# check cfg files
|
||||||
- make checkcfg
|
- make checkcfg
|
||||||
|
# check platform files
|
||||||
|
- make validatePlatforms
|
||||||
|
# Validate Result XML
|
||||||
- make validateXML
|
- make validateXML
|
||||||
|
# Build gui
|
||||||
- cd ./gui
|
- cd ./gui
|
||||||
# clean rebuild
|
# clean rebuild
|
||||||
- git clean -dfx .
|
- git clean -dfx .
|
||||||
# can't set this as env flags, so try again with HAVE_RULES=yes
|
# can't set this as env flags, so try again with HAVE_RULES=yes
|
||||||
- qmake HAVE_RULES=yes
|
- qmake HAVE_RULES=yes
|
||||||
- echo $CXXFLAGS
|
- echo $CXXFLAGS
|
||||||
- make -s -j4
|
- make -s -j2
|
||||||
- cd ../
|
- cd ../
|
||||||
# note: trusty on travis has python pygments disabled so disable these tests on travis
|
# note: trusty on travis has python pygments disabled so disable these tests on travis
|
||||||
## check htmlreport stuff
|
## check htmlreport stuff
|
||||||
|
@ -108,7 +110,7 @@ script:
|
||||||
- git clean -dfx
|
- git clean -dfx
|
||||||
# check what happens if we want to install it to some other dir,
|
# check what happens if we want to install it to some other dir,
|
||||||
- echo $CXXFLAGS
|
- echo $CXXFLAGS
|
||||||
- make -s SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg -j 4
|
- make -s SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg -j 2
|
||||||
- sudo make SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg install
|
- sudo make SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg install
|
||||||
- sudo mkdir -p /usr/share/cppcheck/cfg
|
- sudo mkdir -p /usr/share/cppcheck/cfg
|
||||||
- sudo install -D ./cfg/* -t /usr/share/cppcheck/cfg
|
- sudo install -D ./cfg/* -t /usr/share/cppcheck/cfg
|
||||||
|
@ -116,11 +118,9 @@ script:
|
||||||
- /usr/bin/cppcheck ./cli
|
- /usr/bin/cppcheck ./cli
|
||||||
# check if reduce tool compiles
|
# check if reduce tool compiles
|
||||||
- echo $CXXFLAGS
|
- echo $CXXFLAGS
|
||||||
- make -s reduce -j 4
|
- make -s reduce -j 2
|
||||||
# check if showtime=top5 works
|
# check if showtime=top5 works
|
||||||
- ./tools/test_showtimetop5.sh
|
- ./tools/test_showtimetop5.sh
|
||||||
# check the files in cgf dir with xmllint
|
|
||||||
- xmllint --noout cfg/*
|
|
||||||
# check matchcompiler
|
# check matchcompiler
|
||||||
- ./tools/test_matchcompiler.py
|
- ./tools/test_matchcompiler.py
|
||||||
# check --dump
|
# check --dump
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -264,7 +264,7 @@ test: all
|
||||||
check: all
|
check: all
|
||||||
./testrunner -q
|
./testrunner -q
|
||||||
|
|
||||||
checkcfg: cppcheck validateCFG validatePlatforms
|
checkcfg: cppcheck validateCFG
|
||||||
./test/cfg/runtests.sh
|
./test/cfg/runtests.sh
|
||||||
|
|
||||||
dmake: tools/dmake.o cli/filelister.o $(SRCDIR)/pathmatch.o $(SRCDIR)/path.o externals/simplecpp/simplecpp.o
|
dmake: tools/dmake.o cli/filelister.o $(SRCDIR)/pathmatch.o $(SRCDIR)/path.o externals/simplecpp/simplecpp.o
|
||||||
|
|
|
@ -373,7 +373,7 @@ int main(int argc, char **argv)
|
||||||
fout << "\t./testrunner\n\n";
|
fout << "\t./testrunner\n\n";
|
||||||
fout << "check:\tall\n";
|
fout << "check:\tall\n";
|
||||||
fout << "\t./testrunner -q\n\n";
|
fout << "\t./testrunner -q\n\n";
|
||||||
fout << "checkcfg:\tcppcheck validateCFG validatePlatforms\n";
|
fout << "checkcfg:\tcppcheck validateCFG\n";
|
||||||
fout << "\t./test/cfg/runtests.sh\n\n";
|
fout << "\t./test/cfg/runtests.sh\n\n";
|
||||||
fout << "dmake:\ttools/dmake.o cli/filelister.o $(SRCDIR)/pathmatch.o $(SRCDIR)/path.o externals/simplecpp/simplecpp.o\n";
|
fout << "dmake:\ttools/dmake.o cli/filelister.o $(SRCDIR)/pathmatch.o $(SRCDIR)/path.o externals/simplecpp/simplecpp.o\n";
|
||||||
fout << "\t$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)\n\n";
|
fout << "\t$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)\n\n";
|
||||||
|
|
Loading…
Reference in New Issue