File: analyze.sh

package info (click to toggle)
librist 0.2.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,100 kB
  • sloc: ansic: 15,906; sh: 81; makefile: 6
file content (27 lines) | stat: -rw-r--r-- 702 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
#
# This script must be run through meson
#
# Checks for the presence of clang static analyzer and/or cppcheck and runs them if present.
#

set -e +x

if [ -z ${MESON_SOURCE_ROOT+x} ]; then
    echo "Missing MESON_SOURCE_ROOT";
    exit 1;
fi

perl -pe "s{\@SOURCEDIR\@}{${MESON_SOURCE_ROOT}}g" ${MESON_SOURCE_ROOT}/common/configs/cppcheck-suppressions.in.txt > ${MESON_SOURCE_ROOT}/common/configs/cppcheck-suppressions.txt

if hash scan-build 2>/dev/null; then
    ninja -C ${MESON_BUILD_ROOT} scan-build
else
    echo "scan-build not found, not running."
fi

if hash cppcheck 2>/dev/null; then
    ninja -C ${MESON_BUILD_ROOT} cppcheck
else
    echo "cppcheck not found, not running."
fi