From: Chris Koeritz Date: Tue, 5 Jun 2012 17:28:01 +0000 (-0400) Subject: updated to not barf when a test suite is interrupted before conclusion. X-Git-Tag: 2.140.90~1322 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=68546b6273b85b7f20f64e87bd7ab13da1fe8b70;p=feisty_meow.git updated to not barf when a test suite is interrupted before conclusion. --- diff --git a/scripts/shunit/shunit2 b/scripts/shunit/shunit2 index f27dc140..0dd9acad 100755 --- a/scripts/shunit/shunit2 +++ b/scripts/shunit/shunit2 @@ -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))