From a80407c6379c2443edd9b04a863d22862453f34f Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Wed, 19 Dec 2012 23:05:04 -0500 Subject: [PATCH] Fixed tunit.sh to report test counts and times automatically like junit does, moved the totals into the footer, and updated the readme --- README.md | 3 +-- lib/tunit.sh | 49 ++++++++++++++++++++++++------------------------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index c3ab278..768043b 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,12 @@ Example output akesterson@akesterson-pc ~/source/upstream/git/shunit $ bash tests/tunit.sh - - ==== 0 TESTS in 0 SECONDS : 0 ERRORS, 0 FAILURES ==== [super::class] someTest .... [OK] [super::class] someOtherTest .... [FAILED] generic failure : Yo dawg, I heard you like failures This is some raw data, please read it + ==== 2 TESTS in 0 SECONDS : 1 ERRORS, 1 FAILURES ==== akesterson@akesterson-pc ~/source/upstream/git/shunit $ bash tests/junit.sh diff --git a/lib/tunit.sh b/lib/tunit.sh index d8fdb95..5699f12 100644 --- a/lib/tunit.sh +++ b/lib/tunit.sh @@ -7,6 +7,11 @@ # # If COLOR=on, then the OK/FAIL bits are in RED or GREEN. +TUNIT_FAILURES=0 +TUNIT_ERRORS=0 +TUNIT_TESTS=0 +TUNIT_TIMERSTART=$(date "+%s") + COLOR=${COLOR:-on} if [ "$COLOR" == "on" ]; then @@ -24,36 +29,13 @@ function tunit_header() { if [ "$1" == "--help" ]; then cat <