2015-01-27 19:31:41 +01:00
|
|
|
#!/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
|
|
|
|
|
2015-01-30 06:43:40 +01:00
|
|
|
# posix.c
|
|
|
|
gcc -fsyntax-only ${DIR}posix.c
|
2015-02-16 22:19:51 +01:00
|
|
|
${CPPCHECK} --check-library --library=posix --enable=information --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr ${DIR}posix.c
|
|
|
|
|
|
|
|
# gnu.c
|
|
|
|
gcc -fsyntax-only -D_GNU_SOURCE ${DIR}gnu.c
|
|
|
|
${CPPCHECK} --check-library --library=gnu --enable=information --enable=style --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr ${DIR}gnu.c
|
2015-01-30 06:43:40 +01:00
|
|
|
|
2015-01-27 19:31:41 +01:00
|
|
|
# std.c
|
|
|
|
gcc -fsyntax-only ${DIR}std.c
|
2015-02-16 22:19:51 +01:00
|
|
|
${CPPCHECK} --check-library --enable=information --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr ${DIR}std.c
|