[PATCH 3/4] test: add 'Emacs' prereq to dependent 'emacs' tests
authorPieter Praet <pieter@praet.org>
Tue, 1 Nov 2011 19:49:13 +0000 (20:49 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:39:57 +0000 (09:39 -0800)
fc/7663b3a80cfabbbc015a0af29163a3fe10a847 [new file with mode: 0644]

diff --git a/fc/7663b3a80cfabbbc015a0af29163a3fe10a847 b/fc/7663b3a80cfabbbc015a0af29163a3fe10a847
new file mode 100644 (file)
index 0000000..09a2d12
--- /dev/null
@@ -0,0 +1,331 @@
+Return-Path: <pieter@praet.org>\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 1D9F1429E32\r
+       for <notmuch@notmuchmail.org>; Tue,  1 Nov 2011 12:50:27 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 aUj41cMtjEd5 for <notmuch@notmuchmail.org>;\r
+       Tue,  1 Nov 2011 12:50:24 -0700 (PDT)\r
+Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com\r
+       [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 773ED429E2F\r
+       for <notmuch@notmuchmail.org>; Tue,  1 Nov 2011 12:50:24 -0700 (PDT)\r
+Received: by mail-wy0-f181.google.com with SMTP id 8so2012948wyg.26\r
+       for <notmuch@notmuchmail.org>; Tue, 01 Nov 2011 12:50:24 -0700 (PDT)\r
+Received: by 10.216.230.69 with SMTP id i47mr283127weq.61.1320177024034;\r
+       Tue, 01 Nov 2011 12:50:24 -0700 (PDT)\r
+Received: from localhost ([109.131.187.47])\r
+       by mx.google.com with ESMTPS id b5sm75968wbh.4.2011.11.01.12.50.22\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Tue, 01 Nov 2011 12:50:23 -0700 (PDT)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 3/4] test: add 'Emacs' prereq to dependent 'emacs' tests\r
+Date: Tue,  1 Nov 2011 20:49:13 +0100\r
+Message-Id: <1320176954-4897-4-git-send-email-pieter@praet.org>\r
+X-Mailer: git-send-email 1.7.7.1\r
+In-Reply-To: <1320176954-4897-1-git-send-email-pieter@praet.org>\r
+References: <1320176954-4897-1-git-send-email-pieter@praet.org>\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: Tue, 01 Nov 2011 19:50:27 -0000\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
+---\r
+ test/emacs |   65 ++++++++++++++++++++++++++++++++---------------------------\r
+ 1 files changed, 35 insertions(+), 30 deletions(-)\r
+\r
+diff --git a/test/emacs b/test/emacs\r
+index 0303d7d..8b1e5e4 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_expect_success "prereq: Emacs is present" "which emacs" \\r
++    && test_set_prereq 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,7 +121,7 @@ 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
+@@ -140,7 +145,7 @@ 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
+@@ -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,7 +237,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
+ test_begin_subtest "Reply within emacs"\r
+ test_emacs '(notmuch-search "subject:\"testing message sent via SMTP\"")\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,7 +345,7 @@ 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
+@@ -366,14 +371,14 @@ 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_begin_subtest "Refresh show buffer"\r
+ test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")\r
+           (test-visible-output "EXPECTED")\r
+           (notmuch-show-refresh-view)\r
+           (test-visible-output)'\r
+-test_expect_equal_file OUTPUT EXPECTED\r
++test_expect_equal_file EMACS OUTPUT EXPECTED\r
\r
+ test_begin_subtest "Refresh modified show buffer"\r
+ test_subtest_known_broken\r
+@@ -384,6 +389,6 @@ test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.\r
+           (test-visible-output "EXPECTED")\r
+           (notmuch-show-refresh-view)\r
+           (test-visible-output)'\r
+-test_expect_equal_file OUTPUT EXPECTED\r
++test_expect_equal_file EMACS OUTPUT EXPECTED\r
\r
+ test_done\r
+-- \r
+1.7.7.1\r
+\r