[scripts] add a script to run cppcheck over the source for a given project

This commit is contained in:
Travis Geiselbrecht
2015-11-23 09:17:44 -08:00
parent 8a57db12ee
commit ba6a3f6914

23
scripts/do-cppcheck Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
if [ "$#" -lt 1 ]; then
echo "not enough arguments"
echo "usage: $0 <project>"
exit 1
fi
case `uname` in
Linux)
N=`cat /proc/cpuinfo | grep processor | wc -l`
JOBS=-j$N
;;
*)
JOBS=-j4
;;
esac
PROJ=$1
PROJ_DIR=build-${PROJ}
TESTS="--enable=warning,style,performance,portability,information"
cppcheck --force --file-list=${PROJ_DIR}/srcfiles.txt --includes-file=${PROJ_DIR}/include_paths.txt --include=${PROJ_DIR}/config.h -q --platform=unix32 $TESTS $JOBS