updated to not barf when a test suite is interrupted before conclusion.
authorChris Koeritz <fred@gruntose.com>
Tue, 5 Jun 2012 17:28:01 +0000 (13:28 -0400)
committerChris Koeritz <fred@gruntose.com>
Tue, 5 Jun 2012 17:28:01 +0000 (13:28 -0400)
scripts/shunit/shunit2

index f27dc140a9887f756632703138de16f2bb7a1cf2..0dd9acad8c5c0dcc53ebdde8907888a671a112b7 100755 (executable)
@@ -862,6 +862,10 @@ _shunit_generateReport()
     _shunit_msg_="${_shunit_msg_})"
   fi
 
+  if [ -z "$suite_end" ]; then
+    # make sure we don't get confused, since suite aborted early.
+    suite_end=$(date +%s)
+  fi
   duration_s=$(($suite_end - $suite_start))
   duration_m=$(($duration_s / 60))
   duration_h=$(($duration_m / 60))