]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
testing: Format total time in a more readable way
authorTobias Brunner <tobias@strongswan.org>
Wed, 26 Jul 2023 11:05:56 +0000 (13:05 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 26 Jul 2023 11:06:40 +0000 (13:06 +0200)
testing/do-tests

index 75b6b3e34b027e8b20712373590acf200a59c108..5880c958a95c3a05348e0b668f17a86f9e9295f2 100755 (executable)
@@ -957,6 +957,8 @@ done
 # finish the results html file
 #
 
+printf -v timetotal_fmt '%02d:%02d:%02d' $((timetotal/3600)) $((timetotal%3600/60)) $((timetotal%60))
+
 cat >> $TESTRESULTSHTML << @EOF
     <tr>
       <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
@@ -968,7 +970,7 @@ cat >> $TESTRESULTSHTML << @EOF
       <td><b>Failed</b></td><td><b><font color="red">$failed_cnt</font></b></td><td>&nbsp;</td><td>&nbsp;</td>
     </tr>
     <tr>
-      <td><b>Time [s]</b></td><td><b><font color="blue">$timetotal</font></b></td><td>&nbsp;</td><td>&nbsp;</td>
+      <td><b>Time</b></td><td><b><font color="blue">$timetotal_fmt (${timetotal}s)</font></b></td><td>&nbsp;</td><td>&nbsp;</td>
     </tr>
   </table>
 </body>
@@ -1014,4 +1016,4 @@ echo "or via the link http://$ipv4_winnetou/testresults/$TESTDATE"
 
 ENDDATE=`date +%Y%m%d-%H%M-%S`
 echo
-echo "Finished : $ENDDATE"
+echo "Finished : $ENDDATE ($timetotal_fmt)"