]> git.cworth.org Git - notmuch/blobdiff - test/test-lib.sh
test: implement and document NOTMUCH_TEST_QUIET variable usage
[notmuch] / test / test-lib.sh
index 34e0db68d36cf08e286570cc6e71e75cf4f58287..d8e0d9115a69fa754e3318d978d105bcc282963e 100644 (file)
@@ -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