summaryrefslogtreecommitdiffstats
path: root/cmake/scripts/linux/clang-check-test.sh.in
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2017-08-15 17:40:26 +0200
committermanuel <manuel@mausz.at>2017-08-15 17:40:26 +0200
commit86b22151f0758311fd146ff508e7254337414bc1 (patch)
treefdd6ca46ba57b7f063740541c034ce60c7cdd0c5 /cmake/scripts/linux/clang-check-test.sh.in
parent4c3251ec645c8b71820dab7e51e612e5919d4e75 (diff)
downloadkodi-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/clang-check-test.sh.in')
-rwxr-xr-xcmake/scripts/linux/clang-check-test.sh.in24
1 files changed, 24 insertions, 0 deletions
diff --git a/cmake/scripts/linux/clang-check-test.sh.in b/cmake/scripts/linux/clang-check-test.sh.in
new file mode 100755
index 0000000..3b30ec1
--- /dev/null
+++ b/cmake/scripts/linux/clang-check-test.sh.in
@@ -0,0 +1,24 @@
1#!/bin/bash
2
3# This script performs a single analysis using clang-check
4# It is used by the 'make test' target in the buildsystems
5# Usually you should use 'ctest -C clang-check' rather than calling this script directly
6#
7# Parameters: $1 = Application binary
8# $2 = Source file to process
9
10clangcheck_cmd=$1
11source_file=$2
12
13tmpfil=`mktemp`
14$clangcheck_cmd -p @CMAKE_BINARY_DIR@ -analyze $source_file &> $tmpfil
15nerr=`cat $tmpfil | grep -v "warning: /usr/bin/c++: 'linker' input unused" | wc -l`
16if test $nerr -gt 0
17then
18 cat $tmpfil
19 rm $tmpfil
20 exit 1
21fi
22
23rm $tmpfil
24exit 0