unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: [Patch v4 1/9] test: Add two tests for error output from notmuch_database_open
Date: Sat, 14 Mar 2015 18:02:26 +0100	[thread overview]
Message-ID: <1426352554-4383-2-git-send-email-david@tethera.net> (raw)
In-Reply-To: <1426352554-4383-1-git-send-email-david@tethera.net>

This is arguably testing the same thing twice, but in the brave new
future where we don't use printf anymore, each subcommand will be
responsible for handling the output on it's own.
---
 test/T050-new.sh     | 7 +++++++
 test/T150-tagging.sh | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/test/T050-new.sh b/test/T050-new.sh
index 7119356..e6c3291 100755
--- a/test/T050-new.sh
+++ b/test/T050-new.sh
@@ -276,4 +276,11 @@ test_expect_code 1 "Invalid tags set exit code" \
 
 notmuch config set new.tags $OLDCONFIG
 
+
+test_begin_subtest "Xapian exception: read only files"
+chmod u-w  ${MAIL_DIR}/.notmuch/xapian/*.DB
+output=$(NOTMUCH_NEW 2>&1 | sed 's/: .*$//' )
+chmod u+w  ${MAIL_DIR}/.notmuch/xapian/*.DB
+test_expect_equal "$output" "A Xapian exception occurred opening database"
+
 test_done
diff --git a/test/T150-tagging.sh b/test/T150-tagging.sh
index 45471ac..4a2673d 100755
--- a/test/T150-tagging.sh
+++ b/test/T150-tagging.sh
@@ -261,4 +261,10 @@ test_expect_code 1 "Empty tag names" 'notmuch tag + One'
 
 test_expect_code 1 "Tag name beginning with -" 'notmuch tag +- One'
 
+test_begin_subtest "Xapian exception: read only files"
+chmod u-w  ${MAIL_DIR}/.notmuch/xapian/*.DB
+output=$(notmuch tag +something '*' 2>&1 | sed 's/: .*$//' )
+chmod u+w  ${MAIL_DIR}/.notmuch/xapian/*.DB
+test_expect_equal "$output" "A Xapian exception occurred opening database"
+
 test_done
-- 
2.1.4

  reply	other threads:[~2015-03-14 17:05 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-14 17:02 libnotmuch logging overhaul v4 David Bremner
2015-03-14 17:02 ` David Bremner [this message]
2015-03-14 17:02 ` [Patch v4 2/9] test: add support for compiling and running C snippets David Bremner
2015-03-21  8:51   ` Tomi Ollila
2015-03-14 17:02 ` [Patch v4 3/9] test: add error reporting tests for lib/database.cc David Bremner
2015-03-14 17:02 ` [Patch v4 4/9] lib: add "verbose" versions of notmuch_database_{open,create} David Bremner
2015-03-21  9:27   ` [Patch v4 4/9] lib: add "verbose" versions of notmuch_database_{open, create} Tomi Ollila
2015-03-14 17:02 ` [Patch v4 5/9] lib/database: add field for last error string David Bremner
2015-03-14 17:02 ` [Patch v4 6/9] lib: add a log function with output to a string in notmuch_database_t David Bremner
2015-03-14 17:02 ` [Patch v4 7/9] lib: add private function to extract the database for a message David Bremner
2015-03-14 17:02 ` [Patch v4 8/9] lib: replace almost all fprintfs in library with _n_d_log David Bremner
2015-03-14 17:02 ` [Patch v4 9/9] lib: eliminate fprintf from _notmuch_message_file_open David Bremner
2015-03-24 13:19   ` [Patch v5 1/8] test: Add two tests for error output from notmuch_database_open David Bremner
2015-03-24 13:19     ` [Patch v5 2/8] test: add support for compiling and running C snippets David Bremner
2015-03-24 13:19     ` [Patch v5 3/8] test: add error reporting tests David Bremner
2015-03-24 13:19     ` [Patch v5 4/8] lib: add "verbose" versions of notmuch_database_{open,create} David Bremner
2015-03-24 13:19     ` [Patch v5 5/8] lib: add a log function with output to a string in notmuch_database_t David Bremner
2015-03-24 13:19     ` [Patch v5 6/8] lib: add private function to extract the database for a message David Bremner
2015-03-24 13:19     ` [Patch v5 7/8] lib: replace almost all fprintfs in library with _n_d_log David Bremner
2015-03-24 13:19     ` [Patch v5 8/8] lib: eliminate fprintf from _notmuch_message_file_open David Bremner
2015-03-24 13:24   ` Update to library logging, version 5 David Bremner
2015-03-24 13:24     ` [Patch v5 1/8] test: Add two tests for error output from notmuch_database_open David Bremner
2015-03-24 13:24     ` [Patch v5 2/8] test: add support for compiling and running C snippets David Bremner
2015-03-25 16:09       ` Tomi Ollila
2015-03-24 13:24     ` [Patch v5 3/8] test: add error reporting tests David Bremner
2015-03-25 16:19       ` Tomi Ollila
2015-03-24 13:24     ` [Patch v5 4/8] lib: add "verbose" versions of notmuch_database_{open,create} David Bremner
2015-03-25 16:39       ` [Patch v5 4/8] lib: add "verbose" versions of notmuch_database_{open, create} Tomi Ollila
2015-03-25 16:47         ` [Patch v5 4/8] lib: add "verbose" versions of notmuch_database_{open,create} David Bremner
2015-03-24 13:24     ` [Patch v5 5/8] lib: add a log function with output to a string in notmuch_database_t David Bremner
2015-03-25 16:47       ` Tomi Ollila
2015-03-24 13:24     ` [Patch v5 6/8] lib: add private function to extract the database for a message David Bremner
2015-03-24 13:24     ` [Patch v5 7/8] lib: replace almost all fprintfs in library with _n_d_log David Bremner
2015-03-24 13:24     ` [Patch v5 8/8] lib: eliminate fprintf from _notmuch_message_file_open David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426352554-4383-2-git-send-email-david@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).