projects
/
feisty_meow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of feistymeow.org:feisty_meow
[feisty_meow.git]
/
scripts
/
shunit
/
shunit2
diff --git
a/scripts/shunit/shunit2
b/scripts/shunit/shunit2
old mode 100755
(executable)
new mode 100644
(file)
index
c814489
..
aa0a4e7
--- a/
scripts/shunit/shunit2
+++ b/
scripts/shunit/shunit2
@@
-123,7
+123,7
@@
assertEquals()
shunit_return=${SHUNIT_TRUE}
if [ "${shunit_expected_}" = "${shunit_actual_}" ]; then
if [ ! -z "$DEBUGGING" -a ! -z "$assertion_name" ]; then
shunit_return=${SHUNIT_TRUE}
if [ "${shunit_expected_}" = "${shunit_actual_}" ]; then
if [ ! -z "$DEBUGGING" -a ! -z "$assertion_name" ]; then
- echo " OK: $assertion_name"
+ echo " OK
AY
: $assertion_name"
fi
_shunit_assertPass
else
fi
_shunit_assertPass
else
@@
-166,7
+166,7
@@
assertNotEquals()
shunit_return=${SHUNIT_TRUE}
if [ "${shunit_expected_}" != "${shunit_actual_}" ]; then
if [ ! -z "$DEBUGGING" -a ! -z "$assertion_name" ]; then
shunit_return=${SHUNIT_TRUE}
if [ "${shunit_expected_}" != "${shunit_actual_}" ]; then
if [ ! -z "$DEBUGGING" -a ! -z "$assertion_name" ]; then
- echo " OK: $assertion_name"
+ echo " OK
AY
: $assertion_name"
fi
_shunit_assertPass
else
fi
_shunit_assertPass
else
@@
-357,7
+357,7
@@
assertTrue()
# record the test
if [ ${shunit_return} -eq ${SHUNIT_TRUE} ]; then
if [ ! -z "$DEBUGGING" -a ! -z "$assertion_name" ]; then
# record the test
if [ ${shunit_return} -eq ${SHUNIT_TRUE} ]; then
if [ ! -z "$DEBUGGING" -a ! -z "$assertion_name" ]; then
- echo " OK: $assertion_name"
+ echo " OK
AY
: $assertion_name"
fi
_shunit_assertPass
else
fi
_shunit_assertPass
else
@@
-427,7
+427,7
@@
assertFalse()
# record the test
if [ ${shunit_return} -eq ${SHUNIT_TRUE} ]; then
if [ ! -z "$DEBUGGING" -a ! -z "$assertion_name" ]; then
# record the test
if [ ${shunit_return} -eq ${SHUNIT_TRUE} ]; then
if [ ! -z "$DEBUGGING" -a ! -z "$assertion_name" ]; then
- echo " OK: $assertion_name"
+ echo " OK
AY
: $assertion_name"
fi
_shunit_assertPass
else
fi
_shunit_assertPass
else
@@
-822,7
+822,7
@@
_shunit_execSuite()
unset _shunit_test_
}
unset _shunit_test_
}
-# Generates the user friendly report with appropriate OK/FAILED message.
+# Generates the user friendly report with appropriate OK
AY
/FAILED message.
#
# Args:
# None
#
# Args:
# None
@@
-852,22
+852,31
@@
_shunit_generateReport()
&& _shunit_skipped_="skipped=${__shunit_assertsSkipped}"
if [ ${_shunit_ok_} -eq ${SHUNIT_TRUE} ]; then
&& _shunit_skipped_="skipped=${__shunit_assertsSkipped}"
if [ ${_shunit_ok_} -eq ${SHUNIT_TRUE} ]; then
- _shunit_msg_=
'OK'
+ _shunit_msg_=
"$(basename $0) PASSED 100% OKAY"
[ -n "${_shunit_skipped_}" ] \
&& _shunit_msg_="${_shunit_msg_} (${_shunit_skipped_})"
else
[ -n "${_shunit_skipped_}" ] \
&& _shunit_msg_="${_shunit_msg_} (${_shunit_skipped_})"
else
- _shunit_msg_="FAILED (${_shunit_failures_}"
+ _shunit_msg_="
$(basename $0)
FAILED (${_shunit_failures_}"
[ -n "${_shunit_skipped_}" ] \
&& _shunit_msg_="${_shunit_msg_},${_shunit_skipped_}"
_shunit_msg_="${_shunit_msg_})"
fi
[ -n "${_shunit_skipped_}" ] \
&& _shunit_msg_="${_shunit_msg_},${_shunit_skipped_}"
_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
+ # we keep duration_s for later printing.
duration_s=$(($suite_end - $suite_start))
duration_s=$(($suite_end - $suite_start))
+ # calculate full minutes count based on seconds.
duration_m=$(($duration_s / 60))
duration_m=$(($duration_s / 60))
+ # calculate how many hours that is.
duration_h=$(($duration_m / 60))
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
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 "
S
uite ran for $duration_s total seconds [$duration_h:$duration_m hh:mm]"
+ echo "
Test s
uite ran for $duration_s total seconds [$duration_h:$duration_m hh:mm]"
echo
echo "$(date): ${_shunit_msg_}"
__shunit_reportGenerated=${SHUNIT_TRUE}
echo
echo "$(date): ${_shunit_msg_}"
__shunit_reportGenerated=${SHUNIT_TRUE}