[PATCH 04/13] test: add 'Emacs' prereq to dependent 'emacs' tests
authorThomas Jost <schnouki@schnouki.net>
Mon, 3 Oct 2011 16:47:18 +0000 (18:47 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:39:33 +0000 (09:39 -0800)
b7/669e01e825834fa844b667596f589d9beb35ba [new file with mode: 0644]

diff --git a/b7/669e01e825834fa844b667596f589d9beb35ba b/b7/669e01e825834fa844b667596f589d9beb35ba
new file mode 100644 (file)
index 0000000..77e5263
--- /dev/null
@@ -0,0 +1,355 @@
+Return-Path: <schnouki@schnouki.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 8BF7C431FB6\r
+       for <notmuch@notmuchmail.org>; Mon,  3 Oct 2011 09:48:48 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.1\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id vr1MF-NVFrdd for <notmuch@notmuchmail.org>;\r
+       Mon,  3 Oct 2011 09:48:46 -0700 (PDT)\r
+Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222])\r
+       by olra.theworths.org (Postfix) with ESMTP id 111D6429E25\r
+       for <notmuch@notmuchmail.org>; Mon,  3 Oct 2011 09:48:45 -0700 (PDT)\r
+Received: from localhost.localdomain (thor.loria.fr [152.81.12.250])\r
+       by ks3536.kimsufi.com (Postfix) with ESMTPSA id DB15E6A06B2;\r
+       Mon,  3 Oct 2011 18:48:43 +0200 (CEST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net;\r
+       s=key-schnouki; t=1317660523;\r
+       bh=zoLgJ+GG+rfAESye4oOAFidj0sZ6Fx5hC7howYd/awk=;\r
+       h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:\r
+       In-Reply-To:References;\r
+       b=BJVU4t5FkGB5mGJRHHLMLCu4oc9lSQ6O9YFvZT8HemngIcrxrl00ijTcw8FxD25Xc\r
+       NoffHZphqo1nQHOOymj3Wbm7n0+C5j6yeccxlCJx/NqfyuHBQMXMQVU9s/Xx+0R2Qs\r
+       S/2xVetoxJN9+lQEto3TMAcv9M1HXjDfN2jhob4w=\r
+From: Thomas Jost <schnouki@schnouki.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 04/13] test: add 'Emacs' prereq to dependent 'emacs' tests\r
+Date: Mon,  3 Oct 2011 18:47:18 +0200\r
+Message-Id: <1317660447-27520-5-git-send-email-schnouki@schnouki.net>\r
+X-Mailer: git-send-email 1.7.6.4\r
+In-Reply-To: <1317660447-27520-1-git-send-email-schnouki@schnouki.net>\r
+References: <1317660447-27520-1-git-send-email-schnouki@schnouki.net>\r
+In-Reply-To: <871uuuywtt.fsf@convex-new.cs.unb.ca>\r
+References: <871uuuywtt.fsf@convex-new.cs.unb.ca>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\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: Mon, 03 Oct 2011 16:48:48 -0000\r
+\r
+From: Pieter Praet <pieter@praet.org>\r
+\r
+Adds a new test that checks for the presence of 'emacs',\r
+and adds that test as a prereq to all subsequent tests\r
+that rely on Emacs.\r
+\r
+This causes tests with unmet dependencies to be skipped.\r
+\r
+Signed-off-by: Pieter Praet <pieter@praet.org>\r
+---\r
+ test/emacs |   71 ++++++++++++++++++++++++++++++++---------------------------\r
+ 1 files changed, 38 insertions(+), 33 deletions(-)\r
+\r
+diff --git a/test/emacs b/test/emacs\r
+index 8b627c7..50958ec 100755\r
+--- a/test/emacs\r
++++ b/test/emacs\r
+@@ -3,6 +3,11 @@\r
+ test_description="emacs interface"\r
+ . test-lib.sh\r
\r
++# Emacs is a prereq.\r
++test_set_bin_prereq screen "GNU Screen" SCREEN\r
++test_have_prereq SCREEN && test_set_bin_prereq emacs "Emacs" EMACS\r
++\r
++\r
+ EXPECTED=$TEST_DIRECTORY/emacs.expected-output\r
\r
+ add_email_corpus\r
+@@ -10,7 +15,7 @@ add_email_corpus\r
+ test_begin_subtest "Basic notmuch-hello view in emacs"\r
+ test_emacs '(notmuch-hello)\r
+           (test-output)'\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello\r
++test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-hello\r
\r
+ test_begin_subtest "Saved search with 0 results"\r
+ test_emacs '(let ((notmuch-show-empty-saved-searches t)\r
+@@ -20,20 +25,20 @@ test_emacs '(let ((notmuch-show-empty-saved-searches t)\r
+                       ("empty" . "tag:doesnotexist"))))\r
+             (notmuch-hello)\r
+             (test-output))'\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-with-empty\r
++test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-hello-with-empty\r
\r
+ test_begin_subtest "No saved searches displayed (all with 0 results)"\r
+ test_emacs '(let ((notmuch-saved-searches\r
+                  '\''(("empty" . "tag:doesnotexist"))))\r
+             (notmuch-hello)\r
+             (test-output))'\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-no-saved-searches\r
++test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-hello-no-saved-searches\r
\r
+ test_begin_subtest "Basic notmuch-search view in emacs"\r
+ test_emacs '(notmuch-search "tag:inbox")\r
+           (notmuch-test-wait)\r
+           (test-output)'\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-search-tag-inbox\r
++test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-search-tag-inbox\r
\r
+ test_begin_subtest "Navigation of notmuch-hello to search results"\r
+ test_emacs '(notmuch-hello)\r
+@@ -42,13 +47,13 @@ test_emacs '(notmuch-hello)\r
+           (widget-button-press (point))\r
+           (notmuch-test-wait)\r
+           (test-output)'\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-view-inbox\r
++test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-hello-view-inbox\r
\r
+ test_begin_subtest "Basic notmuch-show view in emacs"\r
+ maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)\r
+ test_emacs "(notmuch-show \"$maildir_storage_thread\")\r
+           (test-output)"\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage\r
++test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage\r
\r
+ test_begin_subtest "notmuch-show for message with invalid From"\r
+ add_message "[subject]=\"message-with-invalid-from\"" \\r
+@@ -64,7 +69,7 @@ Date: Tue, 05 Jan 2001 15:43:57 -0000\r
\r
+ This is just a test message (#1)\r
+ EOF\r
+-test_expect_equal_file OUTPUT EXPECTED\r
++test_expect_equal_file EMACS OUTPUT EXPECTED\r
\r
+ test_begin_subtest "Navigation of notmuch-search to thread view"\r
+ test_emacs '(notmuch-search "tag:inbox")\r
+@@ -74,7 +79,7 @@ test_emacs '(notmuch-search "tag:inbox")\r
+           (notmuch-search-show-thread)\r
+           (notmuch-test-wait)\r
+           (test-output)'\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage\r
++test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage\r
\r
+ test_begin_subtest "Add tag from search view"\r
+ os_x_darwin_thread=$(notmuch search --output=threads id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com)\r
+@@ -82,26 +87,26 @@ test_emacs "(notmuch-search \"$os_x_darwin_thread\")\r
+           (notmuch-test-wait)\r
+           (notmuch-search-add-tag \"tag-from-search-view\")"\r
+ output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
+-test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox tag-from-search-view unread)"\r
++test_expect_equal EMACS "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox tag-from-search-view unread)"\r
\r
+ test_begin_subtest "Remove tag from search view"\r
+ test_emacs "(notmuch-search \"$os_x_darwin_thread\")\r
+           (notmuch-test-wait)\r
+           (notmuch-search-remove-tag \"tag-from-search-view\")"\r
+ output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
+-test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"\r
++test_expect_equal EMACS "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"\r
\r
+ test_begin_subtest "Add tag from notmuch-show view"\r
+ test_emacs "(notmuch-show \"$os_x_darwin_thread\")\r
+           (notmuch-show-add-tag \"tag-from-show-view\")"\r
+ output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
+-test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox tag-from-show-view unread)"\r
++test_expect_equal EMACS "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox tag-from-show-view unread)"\r
\r
+ test_begin_subtest "Remove tag from notmuch-show view"\r
+ test_emacs "(notmuch-show \"$os_x_darwin_thread\")\r
+           (notmuch-show-remove-tag \"tag-from-show-view\")"\r
+ output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
+-test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"\r
++test_expect_equal EMACS "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"\r
\r
+ test_begin_subtest "Message with .. in Message-Id:"\r
+ add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"'\r
+@@ -116,10 +121,10 @@ test_emacs '(notmuch-search "id:\"123..456@example\"")\r
+           (notmuch-show-add-tag "show-remove")\r
+           (notmuch-show-remove-tag "show-remove")'\r
+ output=$(notmuch search 'id:"123..456@example"' | notmuch_search_sanitize)\r
+-test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Message with .. in Message-Id (inbox search-add show-add)"\r
++test_expect_equal EMACS "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Message with .. in Message-Id (inbox search-add show-add)"\r
\r
+ test_begin_subtest "Sending a message via (fake) SMTP"\r
+-emacs_deliver_message \\r
++test_have_prereq EMACS && emacs_deliver_message \\r
+     'Testing message sent via SMTP' \\r
+     'This is a test that messages are sent via SMTP' \\r
+     '(message-goto-to)\r
+@@ -140,12 +145,12 @@ Content-Type: text/plain; charset=us-ascii\r
\r
+ This is a test that messages are sent via SMTP\r
+ EOF\r
+-test_expect_equal_file OUTPUT EXPECTED\r
++test_expect_equal_file EMACS OUTPUT EXPECTED\r
\r
+ test_begin_subtest "Verify that sent messages are saved/searchable (via FCC)"\r
+ notmuch new > /dev/null\r
+ output=$(notmuch search 'subject:"testing message sent via SMTP"' | notmuch_search_sanitize)\r
+-test_expect_equal "$output" "thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; Testing message sent via SMTP (inbox)"\r
++test_expect_equal EMACS "$output" "thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; Testing message sent via SMTP (inbox)"\r
\r
+ test_begin_subtest "notmuch-fcc-dirs set to nil"\r
+ test_emacs "(let ((notmuch-fcc-dirs nil))\r
+@@ -157,7 +162,7 @@ To:\r
+ Subject: \r
+ --text follows this line--\r
+ EOF\r
+-test_expect_equal_file OUTPUT EXPECTED\r
++test_expect_equal_file EMACS OUTPUT EXPECTED\r
\r
+ # Make another FCC maildir specific for the next test\r
+ mkdir -p mail/sent-string/cur\r
+@@ -175,7 +180,7 @@ Subject:\r
+ Fcc: ${MAIL_DIR}/sent-string\r
+ --text follows this line--\r
+ EOF\r
+-test_expect_equal_file OUTPUT EXPECTED\r
++test_expect_equal_file EMACS OUTPUT EXPECTED\r
\r
+ # Make more FCC maildirs specific for the next test\r
+ mkdir -p mail/sent-list-match/cur\r
+@@ -198,7 +203,7 @@ Subject:\r
+ Fcc: ${MAIL_DIR}/sent-list-match\r
+ --text follows this line--\r
+ EOF\r
+-test_expect_equal_file OUTPUT EXPECTED\r
++test_expect_equal_file EMACS OUTPUT EXPECTED\r
\r
+ # Make another FCC maildir specific for the next test\r
+ mkdir -p mail/sent-list-catch-all/cur\r
+@@ -218,7 +223,7 @@ Subject:\r
+ Fcc: ${MAIL_DIR}/sent-list-catch-all\r
+ --text follows this line--\r
+ EOF\r
+-test_expect_equal_file OUTPUT EXPECTED\r
++test_expect_equal_file EMACS OUTPUT EXPECTED\r
\r
+ test_begin_subtest "notmuch-fcc-dirs set to a list (no match)"\r
+ test_emacs "(let ((notmuch-fcc-dirs\r
+@@ -232,14 +237,14 @@ To:\r
+ Subject: \r
+ --text follows this line--\r
+ EOF\r
+-test_expect_equal_file OUTPUT EXPECTED\r
++test_expect_equal_file EMACS OUTPUT EXPECTED\r
\r
+ test_begin_subtest "Reply within emacs"\r
+ test_emacs '(notmuch-search "subject:\"testing message sent via SMTP\"")\r
+           (notmuch-test-wait)\r
+           (notmuch-search-reply-to-thread)\r
+           (test-output)'\r
+-sed -i -e 's/^In-Reply-To: <.*>$/In-Reply-To: <XXX>/' OUTPUT\r
++sed -i -e 's/^In-Reply-To: <.*>$/In-Reply-To: <XXX>/' EMACS OUTPUT\r
+ cat <<EOF >EXPECTED\r
+ From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
+ To: user@example.com\r
+@@ -250,26 +255,26 @@ Fcc: $(pwd)/mail/sent\r
+ On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
+ > This is a test that messages are sent via SMTP\r
+ EOF\r
+-test_expect_equal_file OUTPUT EXPECTED\r
++test_expect_equal_file EMACS OUTPUT EXPECTED\r
\r
+ test_begin_subtest "Save attachment from within emacs using notmuch-show-save-attachments"\r
+ # save as archive to test that Emacs does not re-compress .gz\r
+ test_emacs '(let ((standard-input "\"attachment1.gz\""))\r
+             (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")\r
+             (notmuch-show-save-attachments))' > /dev/null 2>&1\r
+-test_expect_equal_file attachment1.gz "$EXPECTED/attachment"\r
++test_expect_equal_file EMACS attachment1.gz "$EXPECTED/attachment"\r
\r
+ test_begin_subtest "Save attachment from within emacs using notmuch-show-save-part"\r
+ # save as archive to test that Emacs does not re-compress .gz\r
+ test_emacs '(let ((standard-input "\"attachment2.gz\""))\r
+             (notmuch-show-save-part "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com" 5))' > /dev/null 2>&1\r
+-test_expect_equal_file attachment2.gz "$EXPECTED/attachment"\r
++test_expect_equal_file EMACS attachment2.gz "$EXPECTED/attachment"\r
\r
+ test_begin_subtest "View raw message within emacs"\r
+ test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")\r
+           (notmuch-show-view-raw-message)\r
+           (test-output)'\r
+-test_expect_equal_file OUTPUT $EXPECTED/raw-message-cf0c4d-52ad0a\r
++test_expect_equal_file EMACS OUTPUT $EXPECTED/raw-message-cf0c4d-52ad0a\r
\r
+ test_begin_subtest "Hiding/showing signature in notmuch-show view"\r
+ maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)\r
+@@ -279,7 +284,7 @@ test_emacs "(notmuch-show \"$maildir_storage_thread\")\r
+           (search-backward \"Click/Enter to hide.\")\r
+           (button-activate (button-at (point)))\r
+           (test-output)"\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage\r
++test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage\r
\r
+ test_begin_subtest "Detection and hiding of top-post quoting of message"\r
+ add_message '[subject]="The problem with top-posting"' \\r
+@@ -326,13 +331,13 @@ Thanks for the advice! I will be sure to put it to good use.\r
+ -Top Poster\r
\r
+ [ 9-line hidden original message. Click/Enter to show. ]" > EXPECTED\r
+-test_expect_equal_file OUTPUT EXPECTED\r
++test_expect_equal_file EMACS OUTPUT EXPECTED\r
\r
+ test_begin_subtest "Hiding message in notmuch-show view"\r
+ test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")\r
+           (notmuch-show-toggle-message)\r
+           (test-visible-output)'\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages\r
++test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages\r
\r
+ test_begin_subtest "Hiding message with visible citation in notmuch-show view"\r
+ test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")\r
+@@ -340,12 +345,12 @@ test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.\r
+           (button-activate (button-at (point)))\r
+           (notmuch-show-toggle-message)\r
+           (test-visible-output)'\r
+-test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages\r
++test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages\r
\r
+ test_begin_subtest 'Hiding message following HTML part'\r
+ test_subtest_known_broken\r
+ id='html-message@notmuchmail.org'\r
+-emacs_deliver_message \\r
++test_have_prereq EMACS && emacs_deliver_message \\r
+     'HTML message' \\r
+     '' \\r
+     "(message-goto-eoh)\r
+@@ -353,7 +358,7 @@ emacs_deliver_message \\r
+      (message-goto-body)\r
+      (mml-insert-part \"text/html\")\r
+      (insert \"<body>This is a test HTML message</body>\")"\r
+-emacs_deliver_message \\r
++test_have_prereq EMACS && emacs_deliver_message \\r
+     'Reply to HTML message' \\r
+     'This is a reply to the test HTML message' \\r
+     "(message-goto-eoh)\r
+@@ -366,6 +371,6 @@ test_emacs "(notmuch-show \"id:$id\") \\r
+             (notmuch-show-next-message) \\r
+             (notmuch-show-toggle-message) \\r
+             (test-visible-output \"EXPECTED\")"\r
+-test_expect_equal_file OUTPUT EXPECTED\r
++test_expect_equal_file EMACS OUTPUT EXPECTED\r
\r
+ test_done\r
+-- \r
+1.7.6.4\r
+\r