File: check-errorids.sh

package info (click to toggle)
cppcheck 2.19.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,688 kB
  • sloc: cpp: 272,455; python: 22,408; ansic: 8,088; sh: 1,059; makefile: 1,041; xml: 987; cs: 291
file content (31 lines) | stat: -rwxr-xr-x 775 bytes parent folder | download
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
28
29
30
31
#!/bin/bash

#set -x

SCRIPT_DIR="$(dirname "$(realpath "$0")")"

# TODO: exclude testinternal.cpp
echo 'no --errorlist entry:'
grep -h -o -P '\[[a-zA-Z0-9_]+\]\\n\"' $SCRIPT_DIR/../test/*.cpp | tr -d '[]\"' | sed 's/\\n$//' | sort -u | \
while read -r id; do
  if [ ${#id} -lt 4 ]; then
    continue
  fi
  $SCRIPT_DIR/../cppcheck --errorlist | grep "id=\"$id\"" > /dev/null
  # shellcheck disable=SC2181
  if [ $? -ne 0 ]; then
    echo $id
  fi
done

echo ''

echo 'no test coverage:'
$SCRIPT_DIR/../cppcheck --errorlist | grep -h -o -P 'id=\"[a-zA-Z0-9_]*\"' | sed 's/\id=//' | tr -d '\"' | sort -u | \
while read -r id; do
  grep -h -o -P "\[$id\]\\\\n\"" $SCRIPT_DIR/../test/*.cpp > /dev/null
  # shellcheck disable=SC2181
  if [ $? -ne 0 ]; then
    echo $id
  fi
done