[PATCH 2/2] test: add_email_corpus: exit early if notmuch new fails

Subject: [PATCH 2/2] test: add_email_corpus: exit early if notmuch new fails

Date: Wed, 13 Apr 2016 08:35:04 +0300

To: notmuch@notmuchmail.org

Cc: tomi.ollila@iki.fi

From: Tomi Ollila


If notmuch new fails during email corpus addition the database is
most probably inexistent or broken and the added corpus would be
unusable while running single tests, giving misleading failures
("only" full 'make test' cleans out old corpus).
---
 test/test-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/test-lib.sh b/test/test-lib.sh
index 5620b8cef553..668e4270135a 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -552,7 +552,7 @@ add_email_corpus ()
 	cp -a $TEST_DIRECTORY/corpus.mail ${MAIL_DIR}
     else
 	cp -a $TEST_DIRECTORY/corpus ${MAIL_DIR}
-	notmuch new >/dev/null
+	notmuch new >/dev/null || die "'notmuch new' failed while adding email corpus"
 	cp -a ${MAIL_DIR} $TEST_DIRECTORY/corpus.mail
     fi
 }
-- 
2.6.4


Thread: