aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/test-lib.sh
diff options
context:
space:
mode:
authorGravatar Tomi Ollila <tomi.ollila@iki.fi>2013-12-05 14:46:00 +0200
committerGravatar David Bremner <david@tethera.net>2013-12-09 23:29:11 +0800
commit88e6a2995a0108f6ceb94924bd7e6c3623c43dec (patch)
tree5c20c029c7eb6fa23c49da61e054c3dfe73fd3c5 /test/test-lib.sh
parentf05e7f3ce50b5762a56406b29012b25e2d1329b2 (diff)
test: implement and document NOTMUCH_TEST_QUIET variable usage
When NOTMUCH_TEST_QUIET environment variable is set to non-null value messages when new test script starts and when test PASSes are disabled. This eases picking the cases when tests FAIL (as those are still printed).
Diffstat (limited to 'test/test-lib.sh')
-rw-r--r--test/test-lib.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 34e0db68..d8e0d911 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -198,7 +198,10 @@ print_test_description ()
echo $this_test: "Testing ${test_description}"
test_description_printed=1
}
-print_test_description
+if [ -z "$NOTMUCH_TEST_QUIET" ]
+then
+ print_test_description
+fi
exec 5>&1
@@ -717,6 +720,9 @@ test_ok_ () {
return
fi
test_success=$(($test_success + 1))
+ if test -n "$NOTMUCH_TEST_QUIET"; then
+ return 0
+ fi
say_color pass "%-6s" "PASS"
echo " $test_subtest_name"
}
@@ -727,6 +733,7 @@ test_failure_ () {
return
fi
test_failure=$(($test_failure + 1))
+ print_test_description
test_failure_message_ "FAIL" "$test_subtest_name" "$@"
test "$immediate" = "" || { GIT_EXIT_OK=t; exit 1; }
return 1