Skip to content

Commit

Permalink
htmlreport: Fix check.sh with absolute path to suppression rules
Browse files Browse the repository at this point in the history
  • Loading branch information
vpetrigo committed May 7, 2024
1 parent 3114541 commit 1264e18
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/tools/htmlreport/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ if [ -z "$PYTHON" ]; then
fi

SCRIPT_DIR="$(dirname ${BASH_SOURCE[0]})"
ABSOLUTE_SCRIPT_DIR="$(cd -- ${SCRIPT_DIR} ; pwd -P)"
PROJECT_ROOT_DIR="$(cd -- ${SCRIPT_DIR}/../../../ ; pwd -P)"
REPORT_DIR=$(mktemp -d -t htmlreport-XXXXXXXXXX)
INDEX_HTML="$REPORT_DIR/index.html"
Expand Down Expand Up @@ -68,7 +69,7 @@ validate_html "$INDEX_HTML"
validate_html "$STATS_HTML"


${PROJECT_ROOT_DIR}/cppcheck ${PROJECT_ROOT_DIR}/samples/memleak/good.c ${PROJECT_ROOT_DIR}/samples/resourceLeak/good.c --xml-version=2 --enable=information --suppressions-list=test_suppressions.txt --xml 2> "$UNMATCHEDSUPPR_XML"
${PROJECT_ROOT_DIR}/cppcheck ${PROJECT_ROOT_DIR}/samples/memleak/good.c ${PROJECT_ROOT_DIR}/samples/resourceLeak/good.c --xml-version=2 --enable=information --suppressions-list="${ABSOLUTE_SCRIPT_DIR}/test_suppressions.txt" --xml 2> "$UNMATCHEDSUPPR_XML"
xmllint --noout "$UNMATCHEDSUPPR_XML"
$PYTHON ${PROJECT_ROOT_DIR}/htmlreport/cppcheck-htmlreport --file "$UNMATCHEDSUPPR_XML" --title "unmatched Suppressions" --report-dir="$REPORT_DIR"
grep "unmatchedSuppression<.*>information<.*>Unmatched suppression: variableScope*<" "$INDEX_HTML"
Expand Down

0 comments on commit 1264e18

Please sign in to comment.