From cddeaa59ab9c85ae4a09cae769b8677fd60141b8 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 15 Apr 2010 15:18:30 -0700 Subject: [PATCH] make test: Actually count and report on failures. Hurrah---no more manual verification of that PASS column. This means that "make test" can actually be a useful part of the release process now, (since it will exit with non-zero status if there are any failures). --- test/notmuch-test | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/test/notmuch-test b/test/notmuch-test index 2a2c2e5f..53ee1892 100755 --- a/test/notmuch-test +++ b/test/notmuch-test @@ -154,17 +154,23 @@ add_message () $NOTMUCH new > /dev/null } +tests=0 +test_failures=0 + pass_if_equal () { output=$1 expected=$2 + tests=$((tests + 1)) + if [ "$output" = "$expected" ]; then echo " PASS" else echo " FAIL" echo " Expected output: $expected" echo " Actual output: $output" + test_failures=$((test_failures + 1)) fi } @@ -623,9 +629,17 @@ printf " Searching returns all three messages in one thread..." output=$($NOTMUCH search foo | notmuch_search_sanitize) pass_if_equal "$output" "thread:XXX 2000-01-01 [3/3] Notmuch Test Suite; brokenthreadtest (inbox unread)" -cat <