From 68546b6273b85b7f20f64e87bd7ab13da1fe8b70 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Tue, 5 Jun 2012 13:28:01 -0400 Subject: [PATCH] updated to not barf when a test suite is interrupted before conclusion. --- scripts/shunit/shunit2 | 4 ++++ 1 file changed, 4 insertions(+) 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)) -- 2.34.1