diff options
| author | manuel <manuel@mausz.at> | 2017-08-15 17:40:26 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2017-08-15 17:40:26 +0200 |
| commit | 86b22151f0758311fd146ff508e7254337414bc1 (patch) | |
| tree | fdd6ca46ba57b7f063740541c034ce60c7cdd0c5 /cmake/scripts/linux/cppcheck-test.sh.in | |
| parent | 4c3251ec645c8b71820dab7e51e612e5919d4e75 (diff) | |
| download | kodi-pvr-build-86b22151f0758311fd146ff508e7254337414bc1.tar.gz kodi-pvr-build-86b22151f0758311fd146ff508e7254337414bc1.tar.bz2 kodi-pvr-build-86b22151f0758311fd146ff508e7254337414bc1.zip | |
sync with upstream
Diffstat (limited to 'cmake/scripts/linux/cppcheck-test.sh.in')
| -rwxr-xr-x | cmake/scripts/linux/cppcheck-test.sh.in | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/cmake/scripts/linux/cppcheck-test.sh.in b/cmake/scripts/linux/cppcheck-test.sh.in new file mode 100755 index 0000000..08cb672 --- /dev/null +++ b/cmake/scripts/linux/cppcheck-test.sh.in | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | # This script performs a single analysis using cppcheck | ||
| 4 | # It is used by the 'make test' target in the buildsystems | ||
| 5 | # Usually you should use 'ctest -C cppcheck' rather than calling this script directly | ||
| 6 | # | ||
| 7 | # Parameters: $1 = Application binary | ||
| 8 | # $2 = Source file to process | ||
| 9 | # $3..$N = include path parameters (-I dir1 -I dir2 ...) | ||
| 10 | |||
| 11 | cppcheck_cmd=$1 | ||
| 12 | source_file=$2 | ||
| 13 | shift 2 | ||
| 14 | |||
| 15 | tmpfil=`mktemp` | ||
| 16 | $cppcheck_cmd $@ --force --enable=all --suppress=unusedFunction $source_file &> $tmpfil | ||
| 17 | nmatch=`cat $tmpfil | grep "\[.*\]" | wc -l` | ||
| 18 | nnone=`cat $tmpfil | grep "\[\\*]" | wc -l` | ||
| 19 | let "nval=$nmatch-$nnone" | ||
| 20 | if test $nval -gt 0 | ||
| 21 | then | ||
| 22 | cat $tmpfil | ||
| 23 | rm $tmpfil | ||
| 24 | exit 1 | ||
| 25 | fi | ||
| 26 | |||
| 27 | rm $tmpfil | ||
| 28 | exit 0 | ||
