]> git.notmuchmail.org Git - notmuch/commitdiff
test: Report test failures from test_expect_*
authorAustin Clements <amdragon@mit.edu>
Thu, 12 May 2011 13:11:36 +0000 (09:11 -0400)
committerDavid Bremner <bremner@debian.org>
Tue, 13 Sep 2011 02:36:00 +0000 (23:36 -0300)
This makes test_expect_* return non-zero if the test fails, so the
caller can make decisions based on this, such as setting test
prerequisites.

test/test-lib.sh

index b1b0db89602838e78c0d9577cd205842c7835bfe..f8df6a5f1b8f921cabfd39d26a1763d388f30564 100755 (executable)
@@ -563,6 +563,7 @@ test_failure_ () {
        test_failure=$(($test_failure + 1))
        test_failure_message_ "FAIL" "$@"
        test "$immediate" = "" || { GIT_EXIT_OK=t; exit 1; }
+       return 1
 }
 
 test_failure_message_ () {
@@ -584,6 +585,7 @@ test_known_broken_failure_ () {
        test_subtest_known_broken_=
        test_broken=$(($test_broken+1))
        test_failure_message_ "BROKEN" "$@"
+       return 1
 }
 
 test_debug () {