From: Chris Koeritz Date: Fri, 22 Feb 2013 22:55:50 +0000 (-0500) Subject: update for miscounted number of minutes. X-Git-Tag: 2.140.90~1093 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=6eaf8521c92548d7b22191f2a004735dae8e6606;p=feisty_meow.git update for miscounted number of minutes. --- diff --git a/scripts/shunit/shunit2 b/scripts/shunit/shunit2 index 0dd9acad..e9afb3d5 100755 --- a/scripts/shunit/shunit2 +++ b/scripts/shunit/shunit2 @@ -866,9 +866,14 @@ _shunit_generateReport() # make sure we don't get confused, since suite aborted early. suite_end=$(date +%s) fi + # we keep duration_s for later printing. duration_s=$(($suite_end - $suite_start)) + # calculate full minutes count based on seconds. duration_m=$(($duration_s / 60)) + # calculate how many hours that is. duration_h=$(($duration_m / 60)) + # fix the minutes since we chopped those hours out. + duration_m=$(($duration_m - $duration_h * 60)) if [ $duration_m -lt 10 ]; then duration_m="0$duration_m"; fi if [ $duration_h -lt 10 ]; then duration_h="0$duration_h"; fi echo "Test suite ran for $duration_s total seconds [$duration_h:$duration_m hh:mm]"