--- /dev/null
+Return-Path: <bremner@tesseract.cs.unb.ca>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 37C056DE1502\r
+ for <notmuch@notmuchmail.org>; Mon, 3 Aug 2015 23:50:44 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.147\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.147 tagged_above=-999 required=5 tests=[AWL=0.137, \r
+ T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id cP2gJ-PAncDV for <notmuch@notmuchmail.org>;\r
+ Mon, 3 Aug 2015 23:50:42 -0700 (PDT)\r
+Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 3767E6DE13A8\r
+ for <notmuch@notmuchmail.org>; Mon, 3 Aug 2015 23:50:42 -0700 (PDT)\r
+Received: from remotemail by gitolite.debian.net with local (Exim 4.80)\r
+ (envelope-from <bremner@tesseract.cs.unb.ca>)\r
+ id 1ZMW2X-0000QU-Ci; Tue, 04 Aug 2015 06:49:33 +0000\r
+Received: (nullmailer pid 17858 invoked by uid 1000); Tue, 04 Aug 2015\r
+ 06:48:57 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>, David Bremner <david@tethera.net>\r
+Subject: [PATCH 3/3] test: add debugging output to notmuch-new tests, mark 5\r
+ as broken\r
+Date: Tue, 4 Aug 2015 08:48:34 +0200\r
+Message-Id: <1438670914-17203-4-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.1.4\r
+In-Reply-To: <1438670914-17203-1-git-send-email-david@tethera.net>\r
+References: <m2a8ua2gm9.fsf@guru.guru-group.fi>\r
+ <1438670914-17203-1-git-send-email-david@tethera.net>\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 04 Aug 2015 06:50:44 -0000\r
+\r
+I marked the tests where I really couldn't understand the output as\r
+broken. It could also be that I don't understand how directory removal\r
+is supposed to work.\r
+---\r
+ test/T050-new.sh | 62 ++++++++++++++++++++++++++++++++------------------------\r
+ 1 file changed, 35 insertions(+), 27 deletions(-)\r
+\r
+diff --git a/test/T050-new.sh b/test/T050-new.sh\r
+index ab15ca1..ff1c354 100755\r
+--- a/test/T050-new.sh\r
++++ b/test/T050-new.sh\r
+@@ -3,25 +3,25 @@ test_description='"notmuch new" in several variations'\r
+ . ./test-lib.sh\r
+ \r
+ test_begin_subtest "No new messages"\r
+-output=$(NOTMUCH_NEW)\r
++output=$(NOTMUCH_NEW --debug)\r
+ test_expect_equal "$output" "No new mail."\r
+ \r
+ \r
+ test_begin_subtest "Single new message"\r
+ generate_message\r
+-output=$(NOTMUCH_NEW)\r
++output=$(NOTMUCH_NEW --debug)\r
+ test_expect_equal "$output" "Added 1 new message to the database."\r
+ \r
+ \r
+ test_begin_subtest "Multiple new messages"\r
+ generate_message\r
+ generate_message\r
+-output=$(NOTMUCH_NEW)\r
++output=$(NOTMUCH_NEW --debug)\r
+ test_expect_equal "$output" "Added 2 new messages to the database."\r
+ \r
+ \r
+ test_begin_subtest "No new messages (non-empty DB)"\r
+-output=$(NOTMUCH_NEW)\r
++output=$(NOTMUCH_NEW --debug)\r
+ test_expect_equal "$output" "No new mail."\r
+ \r
+ \r
+@@ -31,7 +31,7 @@ mkdir "${MAIL_DIR}"/def\r
+ mkdir "${MAIL_DIR}"/ghi\r
+ generate_message [dir]=def\r
+ \r
+-output=$(NOTMUCH_NEW)\r
++output=$(NOTMUCH_NEW --debug)\r
+ test_expect_equal "$output" "Added 1 new message to the database."\r
+ \r
+ \r
+@@ -42,7 +42,7 @@ mv "${MAIL_DIR}"/ghi "${MAIL_DIR}"/abc\r
+ rm "${MAIL_DIR}"/def/*\r
+ generate_message [dir]=abc\r
+ \r
+-output=$(NOTMUCH_NEW)\r
++output=$(NOTMUCH_NEW --debug)\r
+ test_expect_equal "$output" "Added 1 new message to the database."\r
+ \r
+ \r
+@@ -54,7 +54,7 @@ mkdir -p "$(dirname "$tmp_msg_filename")"\r
+ mv "$gen_msg_filename" "$tmp_msg_filename"\r
+ notmuch new > /dev/null\r
+ mv "$tmp_msg_filename" "$gen_msg_filename"\r
+-output=$(NOTMUCH_NEW)\r
++output=$(NOTMUCH_NEW --debug)\r
+ test_expect_equal "$output" "Added 1 new message to the database."\r
+ \r
+ \r
+@@ -87,34 +87,39 @@ notmuch new > /dev/null\r
+ \r
+ mv "${MAIL_DIR}"/dir "${MAIL_DIR}"/dir-renamed\r
+ \r
+-output=$(NOTMUCH_NEW)\r
+-test_expect_equal "$output" "No new mail. Detected 3 file renames."\r
++output=$(NOTMUCH_NEW --debug)\r
++test_expect_equal "$output" "(D) add_files_recursive, pass 2: queuing passed directory ${MAIL_DIR}/dir for deletion from database\r
++No new mail. Detected 3 file renames."\r
+ \r
+ \r
+ test_begin_subtest "Deleted directory"\r
+-\r
++test_subtest_known_broken\r
+ rm -rf "${MAIL_DIR}"/dir-renamed\r
+ \r
+-output=$(NOTMUCH_NEW)\r
+-test_expect_equal "$output" "No new mail. Removed 3 messages."\r
++output=$(NOTMUCH_NEW --debug)\r
++test_expect_equal "$output" "(D) add_files_recursive, pass 2: queuing passed directory ${MAIL_DIR}/dir-renamed for deletion from database\r
++No new mail. Removed 3 messages."\r
+ \r
+ \r
+ test_begin_subtest "New directory (at end of list)"\r
++test_subtest_known_broken\r
+ \r
+ generate_message [dir]=zzz\r
+ generate_message [dir]=zzz\r
+ generate_message [dir]=zzz\r
+ \r
+-output=$(NOTMUCH_NEW)\r
++output=$(NOTMUCH_NEW --debug)\r
+ test_expect_equal "$output" "Added 3 new messages to the database."\r
+ \r
+ \r
+ test_begin_subtest "Deleted directory (end of list)"\r
+ \r
++test_subtest_known_broken\r
+ rm -rf "${MAIL_DIR}"/zzz\r
+ \r
+-output=$(NOTMUCH_NEW)\r
+-test_expect_equal "$output" "No new mail. Removed 3 messages."\r
++output=$(NOTMUCH_NEW --debug)\r
++test_expect_equal "$output" "(D) add_files_recursive, pass 3: queuing leftover directory ${MAIL_DIR}/zzz for deletion from database\r
++No new mail. Removed 3 messages."\r
+ \r
+ \r
+ test_begin_subtest "New symlink to directory"\r
+@@ -125,7 +130,7 @@ mv "${MAIL_DIR}" "${TMP_DIRECTORY}"/actual_maildir\r
+ mkdir "${MAIL_DIR}"\r
+ ln -s "${TMP_DIRECTORY}"/actual_maildir "${MAIL_DIR}"/symlink\r
+ \r
+-output=$(NOTMUCH_NEW)\r
++output=$(NOTMUCH_NEW --debug)\r
+ test_expect_equal "$output" "Added 1 new message to the database."\r
+ \r
+ \r
+@@ -135,13 +140,13 @@ external_msg_filename="${TMP_DIRECTORY}"/external/"$(basename "$gen_msg_filename\r
+ mkdir -p "$(dirname "$external_msg_filename")"\r
+ mv "$gen_msg_filename" "$external_msg_filename"\r
+ ln -s "$external_msg_filename" "$gen_msg_filename"\r
+-output=$(NOTMUCH_NEW)\r
++output=$(NOTMUCH_NEW --debug)\r
+ test_expect_equal "$output" "Added 1 new message to the database."\r
+ \r
+ \r
+ test_begin_subtest "Broken symlink aborts"\r
+ ln -s does-not-exist "${MAIL_DIR}/broken"\r
+-output=$(NOTMUCH_NEW 2>&1)\r
++output=$(NOTMUCH_NEW --debug 2>&1)\r
+ test_expect_equal "$output" \\r
+ "Error reading file ${MAIL_DIR}/broken: No such file or directory\r
+ Note: A fatal error was encountered: Something went wrong trying to read or write a file\r
+@@ -155,7 +160,7 @@ generate_message [dir]=two/levels\r
+ generate_message [dir]=two/levels\r
+ generate_message [dir]=two/levels\r
+ \r
+-output=$(NOTMUCH_NEW)\r
++output=$(NOTMUCH_NEW --debug)\r
+ test_expect_equal "$output" "Added 3 new messages to the database."\r
+ \r
+ \r
+@@ -163,10 +168,12 @@ test_begin_subtest "Deleted two-level directory"\r
+ \r
+ rm -rf "${MAIL_DIR}"/two\r
+ \r
+-output=$(NOTMUCH_NEW)\r
+-test_expect_equal "$output" "No new mail. Removed 3 messages."\r
++output=$(NOTMUCH_NEW --debug)\r
++test_expect_equal "$output" "(D) add_files_recursive, pass 3: queuing leftover directory ${MAIL_DIR}/two for deletion from database\r
++No new mail. Removed 3 messages."\r
+ \r
+ test_begin_subtest "Support single-message mbox"\r
++test_subtest_known_broken\r
+ cat > "${MAIL_DIR}"/mbox_file1 <<EOF\r
+ From test_suite@notmuchmail.org Fri Jan 5 15:43:57 2001\r
+ From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
+@@ -175,11 +182,12 @@ Subject: Test mbox message 1\r
+ \r
+ Body.\r
+ EOF\r
+-output=$(NOTMUCH_NEW 2>&1)\r
++output=$(NOTMUCH_NEW --debug 2>&1)\r
+ test_expect_equal "$output" "Added 1 new message to the database."\r
+ \r
+ # This test requires that notmuch new has been run at least once.\r
+ test_begin_subtest "Skip and report non-mail files"\r
++test_subtest_known_broken\r
+ generate_message\r
+ mkdir -p "${MAIL_DIR}"/.git && touch "${MAIL_DIR}"/.git/config\r
+ touch "${MAIL_DIR}"/ignored_file\r
+@@ -199,7 +207,7 @@ Subject: Test mbox message 2\r
+ \r
+ Body 2.\r
+ EOF\r
+-output=$(NOTMUCH_NEW 2>&1)\r
++output=$(NOTMUCH_NEW --debug 2>&1)\r
+ test_expect_equal "$output" \\r
+ "Note: Ignoring non-mail file: ${MAIL_DIR}/.git/config\r
+ Note: Ignoring non-mail file: ${MAIL_DIR}/.ignored_hidden_file\r
+@@ -267,23 +275,23 @@ OLDCONFIG=$(notmuch config get new.tags)\r
+ \r
+ test_begin_subtest "Empty tags in new.tags are forbidden"\r
+ notmuch config set new.tags "foo;;bar"\r
+-output=$(NOTMUCH_NEW 2>&1)\r
++output=$(NOTMUCH_NEW --debug 2>&1)\r
+ test_expect_equal "$output" "Error: tag '' in new.tags: empty tag forbidden"\r
+ \r
+ test_begin_subtest "Tags starting with '-' in new.tags are forbidden"\r
+ notmuch config set new.tags "-foo;bar"\r
+-output=$(NOTMUCH_NEW 2>&1)\r
++output=$(NOTMUCH_NEW --debug 2>&1)\r
+ test_expect_equal "$output" "Error: tag '-foo' in new.tags: tag starting with '-' forbidden"\r
+ \r
+ test_expect_code 1 "Invalid tags set exit code" \\r
+- "NOTMUCH_NEW 2>&1"\r
++ "NOTMUCH_NEW --debug 2>&1"\r
+ \r
+ notmuch config set new.tags $OLDCONFIG\r
+ \r
+ \r
+ test_begin_subtest "Xapian exception: read only files"\r
+ chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.DB\r
+-output=$(NOTMUCH_NEW 2>&1 | sed 's/: .*$//' )\r
++output=$(NOTMUCH_NEW --debug 2>&1 | sed 's/: .*$//' )\r
+ chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.DB\r
+ test_expect_equal "$output" "A Xapian exception occurred opening database"\r
+ \r
+-- \r
+2.1.4\r
+\r