Update the header string in runtest.sh (#5785)
authorJiyoung Giuliana Yun <t2wish@gmail.com>
Fri, 14 Oct 2016 19:02:09 +0000 (04:02 +0900)
committerJan Vorlicek <janvorli@microsoft.com>
Fri, 14 Oct 2016 19:02:09 +0000 (21:02 +0200)
Replace 'bc' with the bash expr.
Add the countTotalTests numbers to headers depends on verbose option.

Fix #5677

Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
tests/runtest.sh

index 0c1124f..df552be 100755 (executable)
@@ -738,10 +738,14 @@ function finish_test {
     local testRunningTime=
     local header=
 
+    if ((verbose == 1)); then
+        header=$(printf "[%4d]" $countTotalTests)
+    fi
+
     if [ "$showTime" == "ON" ]; then
         testEndTime=$(date +%s)
-        testRunningTime=$(echo "$testEndTime - ${testStartTimes[$nextProcessIndex]}" | bc)
-        header=$(printf "[%03d:%4.0fs] " "$countTotalTests" "$testRunningTime")
+        testRunningTime=$(( $testEndTime - ${testStartTimes[$nextProcessIndex]} ))
+        header=$header$(printf "[%4ds]" $testRunningTime)
     fi
 
     local xunitTestResult