Skip to content
Permalink
Browse files

cppcheck.sh: make issues in 'error' category to fail build

  • Loading branch information
rouault authored and nyalldawson committed Jun 15, 2020
1 parent 949f631 commit 775ad77a79ca7d6e20a5ec879fadd8ff285a648d
Showing with 6 additions and 2 deletions.
  1. +6 −2 scripts/cppcheck.sh
@@ -28,6 +28,7 @@ cppcheck --library=qt.cfg --inline-suppr \
-DSIP_TRANSFERTHIS= \
-DSIP_INOUT= \
-DSIP_OUT= \
-DCMAKE_SOURCE_DIR="/foo/bar" \
-j $(nproc) \
${SCRIPT_DIR}/../src \
>>${LOG_FILE} 2>&1 &
@@ -45,15 +46,18 @@ fi

ret_code=0

for category in "error" "style" "performance" "portability"; do
cat ${LOG_FILE} | grep -v -e "syntaxError," -e "cppcheckError," > ${LOG_FILE}.tmp
mv ${LOG_FILE}.tmp ${LOG_FILE}

for category in "style" "performance" "portability"; do
if grep "${category}," ${LOG_FILE} >/dev/null; then
echo "INFO: Issues in '${category}' category found, but not considered as making script to fail:"
grep "${category}," ${LOG_FILE} | grep -v "clarifyCalculation,"
echo ""
fi
done

for category in "warning" "clarifyCalculation"; do
for category in "error" "warning" "clarifyCalculation"; do
if grep "${category}," ${LOG_FILE} >/dev/null; then
echo "ERROR: Issues in '${category}' category found:"
grep "${category}," ${LOG_FILE}

0 comments on commit 775ad77

Please sign in to comment.
You can’t perform that action at this time.