tests: add a script which runs test/cfg tests.
add new make target (checkcfg) which builds cppcheck and executes the script make travis run checkcfg
This commit is contained in:
parent
6736fc1b18
commit
e56671101e
|
@ -44,6 +44,8 @@ script:
|
|||
- 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"
|
||||
# check test/cfg
|
||||
- make checkcfg
|
||||
- cd ./gui
|
||||
# clean rebuild
|
||||
- git clean -dfx .
|
||||
|
|
3
Makefile
3
Makefile
|
@ -248,6 +248,9 @@ test: all
|
|||
check: all
|
||||
./testrunner -g -q
|
||||
|
||||
checkcfg: cppcheck
|
||||
./test/cfg/runtests.sh
|
||||
|
||||
dmake: tools/dmake.o cli/filelister.o lib/path.o
|
||||
$(CXX) $(CXXFLAGS) -std=c++0x -o dmake tools/dmake.o cli/filelister.o lib/path.o -Ilib $(LDFLAGS)
|
||||
./dmake
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
set -e # abort on error
|
||||
|
||||
if [[ `pwd` == */test/cfg ]] ; then # we are in test/cfg
|
||||
CPPCHECK="../../cppcheck"
|
||||
DIR=""
|
||||
else # assume we are in repo root
|
||||
CPPCHECK="./cppcheck"
|
||||
DIR=./test/cfg/
|
||||
fi
|
||||
|
||||
# std.c
|
||||
gcc -fsyntax-only ${DIR}std.c
|
||||
${CPPCHECK} --check-library --enable=information --error-exitcode=1 --inline-suppr ${DIR}std.c
|
|
@ -393,6 +393,8 @@ int main(int argc, char **argv)
|
|||
fout << "\t./testrunner\n\n";
|
||||
fout << "check:\tall\n";
|
||||
fout << "\t./testrunner -g -q\n\n";
|
||||
fout << "checkcfg:\tcppcheck\n";
|
||||
fout << "\t./test/cfg/runtests.sh\n\n";
|
||||
fout << "dmake:\ttools/dmake.o cli/filelister.o lib/path.o\n";
|
||||
fout << "\t$(CXX) $(CXXFLAGS) -std=c++0x -o dmake tools/dmake.o cli/filelister.o lib/path.o -Ilib $(LDFLAGS)\n";
|
||||
fout << "\t./dmake\n\n";
|
||||
|
|
Loading…
Reference in New Issue