From d850ea41a25078ac3320b0a1c62d39dfbb3a18c7 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Wed, 22 Apr 2015 15:02:08 +0100 Subject: [PATCH] Report overall status after running all suites --- test/config.sh | 8 ++++++++ test/run_all.sh | 15 +++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/test/config.sh b/test/config.sh index 432a0a54..c67896ba 100644 --- a/test/config.sh +++ b/test/config.sh @@ -52,6 +52,14 @@ greyly () { colourise '0;37' "$@" } +redly() { + colourise '1;31' "$@" +} + +greenly() { + colourise '1;32' "$@" +} + run_on() { host=$1 shift 1 diff --git a/test/run_all.sh b/test/run_all.sh index f69977c1..5ea2755d 100755 --- a/test/run_all.sh +++ b/test/run_all.sh @@ -9,6 +9,21 @@ if ! bash ./sanity_check.sh; then fi whitely echo ...ok +# Modified version of _assert_cleanup from assert.sh that +# prints overall status +check_test_status() { + if [ $? -ne 0 ]; then + redly echo "---= !!!ABNORMAL TEST TERMINATION!!! =---" + elif [ $tests_suite_status -ne 0 ]; then + redly echo "---= !!!SUITE FAILURES - SEE ABOVE FOR DETAILS!!! =---" + exit $tests_suite_status + else + greenly echo "---= ALL SUITES PASSED =---" + fi +} +# Overwrite assert.sh _assert_cleanup trap with our own +trap check_test_status EXIT + for t in *_test.sh; do echo greyly echo "---= Running $t =---"