1 Return-Path: <pieter@praet.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id E0B86429E28
\r
6 for <notmuch@notmuchmail.org>; Thu, 2 Jun 2011 05:04:26 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id TfOpQs119hMy for <notmuch@notmuchmail.org>;
\r
16 Thu, 2 Jun 2011 05:04:25 -0700 (PDT)
\r
17 Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com
\r
18 [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id A8110429E2D
\r
21 for <notmuch@notmuchmail.org>; Thu, 2 Jun 2011 05:04:24 -0700 (PDT)
\r
22 Received: by mail-wy0-f181.google.com with SMTP id 11so603864wyi.26
\r
23 for <notmuch@notmuchmail.org>; Thu, 02 Jun 2011 05:04:24 -0700 (PDT)
\r
24 Received: by 10.227.131.31 with SMTP id v31mr684965wbs.19.1307016264270;
\r
25 Thu, 02 Jun 2011 05:04:24 -0700 (PDT)
\r
26 Received: from localhost ([109.131.21.86])
\r
27 by mx.google.com with ESMTPS id b10sm350118wbh.43.2011.06.02.05.04.22
\r
28 (version=TLSv1/SSLv3 cipher=OTHER);
\r
29 Thu, 02 Jun 2011 05:04:23 -0700 (PDT)
\r
30 From: Pieter Praet <pieter@praet.org>
\r
31 To: Notmuch Mail <notmuch@notmuchmail.org>
\r
32 Subject: [PATCH 3/4] test: add 'Emacs' prereq to dependent 'emacs' tests
\r
33 Date: Thu, 2 Jun 2011 14:03:39 +0200
\r
34 Message-Id: <1307016220-17509-4-git-send-email-pieter@praet.org>
\r
35 X-Mailer: git-send-email 1.7.4.1
\r
36 In-Reply-To: <1307016220-17509-1-git-send-email-pieter@praet.org>
\r
37 References: <1307016220-17509-1-git-send-email-pieter@praet.org>
\r
38 Cc: Austin Clements <amdragon@mit.edu>
\r
39 X-BeenThere: notmuch@notmuchmail.org
\r
40 X-Mailman-Version: 2.1.13
\r
42 List-Id: "Use and development of the notmuch mail system."
\r
43 <notmuch.notmuchmail.org>
\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
47 List-Post: <mailto:notmuch@notmuchmail.org>
\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
51 X-List-Received-Date: Thu, 02 Jun 2011 12:04:27 -0000
\r
53 Adds a new test that checks for the presence of 'emacs',
\r
54 and adds that test as a prereq to all subsequent tests
\r
57 This causes tests with unmet dependencies to be skipped.
\r
59 Signed-off-by: Pieter Praet <pieter@praet.org>
\r
61 test/emacs | 43 ++++++++++++++++++++++++-------------------
\r
62 1 files changed, 24 insertions(+), 19 deletions(-)
\r
64 diff --git a/test/emacs b/test/emacs
\r
65 index da8ba68..10138a6 100755
\r
69 test_description="emacs interface"
\r
72 +# Emacs is a prereq.
\r
73 +test_expect_success "prereq: Emacs is present" "which emacs" \
\r
74 + && test_set_prereq EMACS
\r
77 EXPECTED=../emacs.expected-output
\r
81 test_begin_subtest "Basic notmuch-hello view in emacs"
\r
82 test_emacs '(notmuch-hello) (princ (buffer-string))' >OUTPUT
\r
83 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello
\r
84 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-hello
\r
86 test_begin_subtest "Saved search with 0 results"
\r
87 test_emacs '(setq notmuch-show-empty-saved-searches t) (setq notmuch-saved-searches '\''(("inbox" . "tag:inbox") ("unread" . "tag:unread") ("empty" . "tag:doesnotexist"))) (notmuch-hello) (princ (buffer-string))' >OUTPUT
\r
88 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-with-empty
\r
89 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-hello-with-empty
\r
91 test_begin_subtest "No saved searches displayed (all with 0 results)"
\r
92 test_emacs '(setq notmuch-saved-searches '\''(("empty" . "tag:doesnotexist"))) (notmuch-hello) (princ (buffer-string))' >OUTPUT
\r
93 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-no-saved-searches
\r
94 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-hello-no-saved-searches
\r
96 test_begin_subtest "Basic notmuch-search view in emacs"
\r
97 test_emacs '(notmuch-search "tag:inbox") (notmuch-test-wait) (princ (buffer-string))' >OUTPUT
\r
98 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-search-tag-inbox
\r
99 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-search-tag-inbox
\r
101 test_begin_subtest "Navigation of notmuch-hello to search results"
\r
102 test_emacs '(notmuch-hello) (goto-char (point-min)) (re-search-forward "inbox") (widget-button-press (point)) (notmuch-test-wait) (princ (buffer-string))' >OUTPUT
\r
103 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-view-inbox
\r
104 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-hello-view-inbox
\r
106 test_begin_subtest "Basic notmuch-show view in emacs"
\r
107 maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
\r
108 test_emacs "(notmuch-show \"$maildir_storage_thread\") (princ (buffer-string))" >OUTPUT
\r
109 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
\r
110 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
\r
112 test_begin_subtest "Navigation of notmuch-search to thread view"
\r
113 test_emacs '(notmuch-search "tag:inbox") (notmuch-test-wait) (goto-char (point-min)) (re-search-forward "Working with Maildir") (notmuch-search-show-thread) (notmuch-test-wait) (princ (buffer-string))' >OUTPUT
\r
114 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
\r
115 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
\r
117 test_begin_subtest "Add tag from search view"
\r
118 os_x_darwin_thread=$(notmuch search --output=threads id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com)
\r
119 test_emacs "(notmuch-search \"$os_x_darwin_thread\") (notmuch-test-wait) (notmuch-search-add-tag \"tag-from-search-view\")"
\r
120 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
\r
121 -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
122 +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
124 test_begin_subtest "Remove tag from search view"
\r
125 test_emacs "(notmuch-search \"$os_x_darwin_thread\") (notmuch-test-wait) (notmuch-search-remove-tag \"tag-from-search-view\")"
\r
126 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
\r
127 -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
128 +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
130 test_begin_subtest "Add tag from notmuch-show view"
\r
131 test_emacs "(notmuch-show \"$os_x_darwin_thread\") (notmuch-show-add-tag \"tag-from-show-view\")"
\r
132 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
\r
133 -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
134 +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
136 test_begin_subtest "Remove tag from notmuch-show view"
\r
137 test_emacs "(notmuch-show \"$os_x_darwin_thread\") (notmuch-show-remove-tag \"tag-from-show-view\")"
\r
138 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
\r
139 -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
140 +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
142 test_begin_subtest "Message with .. in Message-Id:"
\r
143 add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"'
\r
144 test_emacs '(notmuch-search "id:\"123..456@example\"") (notmuch-test-wait) (notmuch-search-add-tag "search-add") (notmuch-search-add-tag "search-remove") (notmuch-search-remove-tag "search-remove") (notmuch-show "id:\"123..456@example\"") (notmuch-test-wait) (notmuch-show-add-tag "show-add") (notmuch-show-add-tag "show-remove") (notmuch-show-remove-tag "show-remove")'
\r
145 output=$(notmuch search 'id:"123..456@example"' | notmuch_search_sanitize)
\r
146 -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
147 +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
149 test_begin_subtest "Sending a message via (fake) SMTP"
\r
151 @@ -89,12 +94,12 @@ Content-Type: text/plain; charset=us-ascii
\r
153 This is a test that messages are sent via SMTP
\r
155 -test_expect_equal_file OUTPUT EXPECTED
\r
156 +test_expect_equal_file EMACS OUTPUT EXPECTED
\r
158 test_begin_subtest "Verify that sent messages are saved/searchable (via FCC)"
\r
159 notmuch new > /dev/null
\r
160 output=$(notmuch search 'subject:"testing message sent via SMTP"' | notmuch_search_sanitize)
\r
161 -test_expect_equal "$output" "thread:XXX 1974-03-29 [1/1] Notmuch Test Suite; Testing message sent via SMTP (inbox)"
\r
162 +test_expect_equal EMACS "$output" "thread:XXX 1974-03-29 [1/1] Notmuch Test Suite; Testing message sent via SMTP (inbox)"
\r
164 test_begin_subtest "Reply within emacs"
\r
165 # We sed away everything before the ^From in the output to avoid getting
\r
166 @@ -110,22 +115,22 @@ Fcc: $(pwd)/mail/sent
\r
167 On Fri, 29 Mar 1974 10:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:
\r
168 > This is a test that messages are sent via SMTP
\r
170 -test_expect_equal_file OUTPUT EXPECTED
\r
171 +test_expect_equal_file EMACS OUTPUT EXPECTED
\r
173 test_begin_subtest "Save attachment from within emacs using notmuch-show-save-attachments"
\r
174 # save as archive to test that Emacs does not re-compress .gz
\r
175 echo ./attachment1.gz | test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com") (notmuch-show-save-attachments)' > /dev/null 2>&1
\r
176 -test_expect_equal_file "$EXPECTED/attachment" attachment1.gz
\r
177 +test_expect_equal_file EMACS "$EXPECTED/attachment" attachment1.gz
\r
179 test_begin_subtest "Save attachment from within emacs using notmuch-show-save-part"
\r
180 # save as archive to test that Emacs does not re-compress .gz
\r
181 echo ./attachment2.gz | test_emacs '(notmuch-show-save-part "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com" 5)' > /dev/null 2>&1
\r
182 -test_expect_equal_file "$EXPECTED/attachment" attachment2.gz
\r
183 +test_expect_equal_file EMACS "$EXPECTED/attachment" attachment2.gz
\r
185 test_begin_subtest "View raw message within emacs"
\r
186 first_line=$(head -n1 $EXPECTED/raw-message-cf0c4d-52ad0a)
\r
187 test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com") (notmuch-show-view-raw-message) (princ (buffer-string))' | sed -ne "/$first_line/,\$ p" >OUTPUT
\r
188 -test_expect_equal_file OUTPUT $EXPECTED/raw-message-cf0c4d-52ad0a
\r
189 +test_expect_equal_file EMACS OUTPUT $EXPECTED/raw-message-cf0c4d-52ad0a
\r
191 test_begin_subtest "Hiding/showing signature in notmuch-show view"
\r
192 maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
\r
193 @@ -135,6 +140,6 @@ test_emacs "(notmuch-show \"$maildir_storage_thread\")
\r
194 (search-backward \"Click/Enter to hide.\")
\r
195 (button-activate (button-at (point)))
\r
196 (princ (buffer-string))" >OUTPUT
\r
197 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
\r
198 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
\r