Added option "-p" showing the progress
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 12 Nov 2018 06:27:40 +0000 (15:27 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 12 Nov 2018 06:27:40 +0000 (15:27 +0900)
With -p the progress is printed out.

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

diff --git a/ssat.sh b/ssat.sh
index 6e039de..8c0d930 100755 (executable)
--- a/ssat.sh
+++ b/ssat.sh
@@ -40,6 +40,7 @@ TESTCASE="runTest.sh"
 
 #
 SILENT=1
+PROGRESS=0
 date=`date +"%b %d %Y"`
 
 ## @fn createTemplate()
@@ -114,6 +115,9 @@ do
                printf "Create a template 'runTest.sh' test group at your current directory\n"
                printf "    --createtemplate or -c\n"
                printf "\n"
+               printf "Show progress during execution\n"
+               printf "    --progress or -p\n"
+               printf "\n"
                printf "Shows this message\n"
                printf "    --help or -h\n"
                printf "    $ ${BASENAME} --help \n"
@@ -137,6 +141,10 @@ do
        createTemplate
        shift
        ;;
+       -p|--progress)
+       PROGRESS=1
+       shift
+       ;;
        *) # Unknown, which is probably target (the path to root-dir of test groups).
        TARGET="$1"
        shift
@@ -168,6 +176,9 @@ do
        Nfail=0
        tmpfile=$(mktemp)
 
+       if [[ "$PROGRESS" -eq "1" ]]; then
+               printf "[Starting] $CASENAME\n"
+       fi
        pushd $CASEBASEPATH > /dev/null
        output=$(. $file $CASEBASEPATH)
        retcode=$?