Skip to content

Commit c2197e9

Browse files
committed
added script to detect missing --errorlist entries and test coverage
1 parent 6d61fb6 commit c2197e9

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tools/errorid.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
#set -x
4+
5+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6+
7+
# TODO: exclude testinternal.cpp
8+
echo 'no --errorlist entry:'
9+
grep -h -o -P '\[[a-zA-Z0-9_]+\]\\n\"' $DIR/../test/*.cpp | tr -d '[]\"' | sed 's/\\n$//' | sort -u | \
10+
while read -r id; do
11+
if [ ${#id} -lt 4 ]; then
12+
continue
13+
fi
14+
$DIR/../cppcheck --errorlist | grep "id=\"$id\"" > /dev/null
15+
if [ $? -ne 0 ]; then
16+
echo $id
17+
fi
18+
done
19+
20+
echo 'no test coverage:'
21+
$DIR/../cppcheck --errorlist | grep -h -o -P 'id=\"[a-zA-Z0-9_]*\"' | sed 's/\id=//' | tr -d '\"' | sort -u | \
22+
while read -r id; do
23+
grep -h -o -P "\[$id\]\\\\n\"" $DIR/../test/*.cpp > /dev/null
24+
if [ $? -ne 0 ]; then
25+
echo $id
26+
fi
27+
done

0 commit comments

Comments
 (0)