Added Valgrind as an option
authorParichay Kapoor <pk.kapoor@samsung.com>
Mon, 15 Apr 2019 06:01:05 +0000 (15:01 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 15 Apr 2019 10:25:18 +0000 (19:25 +0900)
Valgrind can be enabled by passing --enable-valgrind to ssat
Currently, --full-leaks and --suppressions are not enabled for valgrind

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
ssat-api.sh
ssat.sh

index 7d9c73c..de38937 100644 (file)
@@ -264,7 +264,11 @@ function callCompareTest() {
 ## @param $4 set 1 if this passes if gstLaunch fails.
 ## @param $5 set 1 to enable PERFORMANCE test.
 function gstTest() {
-       calloutput=$(gst-launch-1.0 -f -q $1)
+       if [[ "$VALGRIND" -eq "1" ]]; then
+               calloutputprefix='valgrind --track-origins=yes'
+       fi
+       calloutput=$(eval $calloutputprefix gst-launch-1.0 -f -q $1)
+
        retcode=$?
        desired=0
        if [[ "${4}" -eq "1" ]]; then
diff --git a/ssat.sh b/ssat.sh
index 8c0d930..a1b8431 100755 (executable)
--- a/ssat.sh
+++ b/ssat.sh
@@ -41,6 +41,7 @@ TESTCASE="runTest.sh"
 #
 SILENT=1
 PROGRESS=0
+VALGRIND=0
 date=`date +"%b %d %Y"`
 
 ## @fn createTemplate()
@@ -118,6 +119,9 @@ do
                printf "Show progress during execution\n"
                printf "    --progress or -p\n"
                printf "\n"
+               printf "Enable valgrind to perform memcheck\n"
+               printf "    --enable-valgrind or -vg\n"
+               printf "\n"
                printf "Shows this message\n"
                printf "    --help or -h\n"
                printf "    $ ${BASENAME} --help \n"
@@ -145,6 +149,10 @@ do
        PROGRESS=1
        shift
        ;;
+       -vg|--enable-valgrind)
+       VALGRIND=1
+       shift
+       ;;
        *) # Unknown, which is probably target (the path to root-dir of test groups).
        TARGET="$1"
        shift