diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2018-06-09 14:46:05 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2018-06-09 14:46:05 +0200 |
| commit | fa62d68b95b6295c204f3b9c91f5cef7a73c436c (patch) | |
| tree | 306590fa209e43c6c3c95d4045bb2d5695a08be6 /scripts/cppcheck.sh | |
| parent | 0f67d9f1796ebb26fe78335236068a7a02b44884 (diff) | |
| download | PROJ-fa62d68b95b6295c204f3b9c91f5cef7a73c436c.tar.gz PROJ-fa62d68b95b6295c204f3b9c91f5cef7a73c436c.zip | |
cppcheck.sh: enable to run it from any directory
Diffstat (limited to 'scripts/cppcheck.sh')
| -rwxr-xr-x | scripts/cppcheck.sh | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/cppcheck.sh b/scripts/cppcheck.sh index df939c06..f1e19f81 100755 --- a/scripts/cppcheck.sh +++ b/scripts/cppcheck.sh @@ -4,13 +4,27 @@ LOG_FILE=/tmp/cppcheck_proj.txt +SCRIPT_DIR=$(dirname "$0") +case $SCRIPT_DIR in + "/"*) + ;; + ".") + SCRIPT_DIR=$(pwd) + ;; + *) + SCRIPT_DIR=$(pwd)/$(dirname "$0") + ;; +esac + +TOPDIR="$SCRIPT_DIR/.." + echo "" > ${LOG_FILE} -for dirname in src; do +for dirname in ${TOPDIR}/src; do echo "Running cppcheck on $dirname... (can be long)" if ! cppcheck --inline-suppr --template='{file}:{line},{severity},{id},{message}' \ --enable=all --inconclusive --std=posix \ -DCPPCHECK \ - $dirname \ + "$dirname" \ -j 8 >>${LOG_FILE} 2>&1 ; then echo "cppcheck failed" exit 1 |
