aboutsummaryrefslogtreecommitdiff
path: root/run-static-analysis.sh
diff options
context:
space:
mode:
Diffstat (limited to 'run-static-analysis.sh')
-rwxr-xr-xrun-static-analysis.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/run-static-analysis.sh b/run-static-analysis.sh
new file mode 100755
index 000000000..0524c469a
--- /dev/null
+++ b/run-static-analysis.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+if [[ "${STATIC_ANALYSIS}" == "yes" ]]; then
+ # cppcheck
+ if ! [ -x "$(command -v cppcheck)" ]; then
+ echo 'Error: cppcheck is not installed.' >&2
+ exit 1
+ fi
+ CPPCHECK_OPTS='--error-exitcode=0 --force --quiet'
+ # we exclude some external projects
+ CPPCHECK_EXCLUDES='-i ./nx-X11/extras/Mesa* -i ./nx-X11/extras/Mesa_* -i nx-X11/programs/Xserver/GL/mesa*'
+ echo "$(cppcheck --version):";
+ cppcheck $CPPCHECK_OPTS $CPPCHECK_EXCLUDES .;
+fi