[PATCH 2/2] test: add_email_corpus: exit early if notmuch new fails
Tomi Ollila
tomi.ollila at iki.fi
Tue Apr 12 22:35:04 PDT 2016
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
More information about the notmuch
mailing list