valgrind: suppress errors with a given file
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 17 Aug 2023 03:19:21 +0000 (12:19 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 17 Aug 2023 05:55:12 +0000 (14:55 +0900)
Users may want to suppress some valgrind errors.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
ssat-api.sh
ssat.sh

index a81b61d..8b26b4f 100644 (file)
@@ -309,7 +309,7 @@ function callCompareTest() {
 ## @param $6 set a positive value (seconds) to enable timeout mode.
 function gstTest() {
        if [[ "$VALGRIND" -eq "1" ]]; then
-               calloutputprefix='valgrind --track-origins=yes'
+               calloutputprefix="valgrind --track-origins=yes ${VALGRIND_SUPPRESSION}"
        fi
 
        TIMEOUT_AVAIL=1
diff --git a/ssat.sh b/ssat.sh
index a3a1295..5461ba3 100755 (executable)
--- a/ssat.sh
+++ b/ssat.sh
@@ -45,6 +45,7 @@ PROGRESSLOGLEVEL=0
 COUNTNEGATIVE=0
 COUNTNEGATIVEPOSTFIX=""
 VALGRIND=0
+VALGRIND_SUPPRESSION=""
 date=`date +"%b %d %Y"`
 
 ## @fn createTemplate()
@@ -94,7 +95,7 @@ do
        key="$1"
        case $key in
        -h|--help)
-               printf "usage: ${BASENAME} [--help] [<path>] [--testcase <filename>] [--nocolor] [--showstdout] [--createtemplate] [--countnegative <postfix>] \n\n"
+               printf "usage: ${BASENAME} [--help] [<path>] [--testcase <filename>] [--nocolor] [--showstdout] [--createtemplate] [--countnegative <postfix>] [--enable-valgrind] [--valgrind-suppression <filepath>]\n\n"
                printf "These are common ${Red}ssat${NC} commands used:\n\n"
                printf "Test all test-groups in the current ($(pwd)) directory, recursively\n"
                printf "    (no options specified)\n"
@@ -130,6 +131,11 @@ do
                printf "Enable valgrind to perform memcheck\n"
                printf "    --enable-valgrind or -vg\n"
                printf "\n"
+               printf "Suppress valgrind errors with the given suppression file\n"
+               printf "    --valgrind-suppression <path to the suppression file>\n"
+               printf "    or \n"
+               printf "    -vs <path to the suppression file>\n"
+               printf "\n"
                printf "Shows this message\n"
                printf "    --help or -h\n"
                printf "    $ ${BASENAME} --help \n"
@@ -187,6 +193,11 @@ do
        VALGRIND=1
        shift
        ;;
+       -vs|--valgrind-suppression)
+       VALGRIND_SUPPRESSION=" --suppressions=$2 "
+       shift
+       shift
+       ;;
        --summary)
        SUMMARYFILENAME="$2"
        shift