run-static-analysis.sh 574 Bytes
Newer Older
1 2 3 4 5 6 7 8
#!/bin/bash

if [[ "${STATIC_ANALYSIS}" == "yes" ]]; then
    # cppcheck
    if ! [ -x "$(command -v cppcheck)" ]; then
        echo 'Error: cppcheck is not installed.' >&2
        exit 1
    fi
9
    CPPCHECK_OPTS='--error-exitcode=0 --force --quiet --suppressions-list=./static-analysis-suppressions'
10
    # we exclude some external projects
11
    CPPCHECK_EXCLUDES='-i ./nx-X11/extras/ -i nx-X11/programs/Xserver/GL/mesa* -i ./.pc -i ./nx-X11/.build-exports -i ./nx-X11/exports -i ./doc'
12 13 14
    echo "$(cppcheck --version):";
    cppcheck $CPPCHECK_OPTS $CPPCHECK_EXCLUDES .;
fi