Add "--summary <filename>" option accepted/tizen/unified/20191218.120945 submit/tizen/20191218.033148
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 18 Dec 2019 03:29:22 +0000 (12:29 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 18 Dec 2019 03:29:22 +0000 (12:29 +0900)
Write a summary of test results to the given filename.

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

diff --git a/ssat.sh b/ssat.sh
index a050242..d01f59f 100755 (executable)
--- a/ssat.sh
+++ b/ssat.sh
@@ -37,6 +37,7 @@ TARGET=$(pwd)
 BASEPATH=`dirname "$0"`
 BASENAME=`basename "$0"`
 TESTCASE="runTest.sh"
+SUMMARYFILENAME=""
 
 #
 SILENT=1
@@ -125,6 +126,9 @@ do
                printf "Shows this message\n"
                printf "    --help or -h\n"
                printf "    $ ${BASENAME} --help \n"
+               printf "\n"
+               printf "Write result summary as a file\n"
+               printf "    --summary <filename>\n"
                printf "\n\n"
                exit 0
        ;;
@@ -153,6 +157,11 @@ do
        VALGRIND=1
        shift
        ;;
+       --summary)
+       SUMMARYFILENAME="$2"
+       shift
+       shift
+       ;;
        *) # Unknown, which is probably target (the path to root-dir of test groups).
        TARGET="$1"
        shift
@@ -232,6 +241,10 @@ printf "==================================================\n\n"
 printf "$groupLog"
 printf "==================================================\n"
 
+if [ "${SUMMARYFILENAME}" != "" ]
+then
+       echo "passed=${TNtcpass}, failed=${TNtcfail}, ignored=${TNtcignore}" > "${SUMMARYFILENAME}"
+fi
 if (( ${TNgroupfail} == 0 ))
 then
        printf "${LightGreen}[PASSED] ${Blue}All Test Groups (${TNgroup}) Passed!${NC}\n"