-
Notifications
You must be signed in to change notification settings - Fork 1.5k
refs #12232/#7772 - added script to detect missing --errorlist
entries and test coverage / added some missing --errorlist
entries
#7439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the filename is pretty generic so it's not easy to understand exactly what it does. And there is no comment that explains it neither. can it be clarified.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. Will adjust the name and document it in the related markdown file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added some documentation in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still think the filename is too generic but I don't feel I have a very good suggestion.. how about:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried coming up with something but couldn't. The suggestions are equally missing the point. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will give it another thought tomorrow as I am also not satisfied with the name. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Definitely something containing "errorid". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like "check-errorids" . but no strong opinion about those other. they are better than the existing filename. imho I would add
the names are a bit longish but imho this is fine. |
||
|
||
#set -x | ||
|
||
SCRIPT_DIR="$(dirname "$(realpath "$0")")" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Imho it would be easier to maintain a python script than a bash script. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but I started out with these shell commands and I didn't feel like try to replicate it in Python for now. It is also sufficient until we want to integrate it into the CI. |
||
|
||
# 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 |
Uh oh!
There was an error while loading. Please reload this page.