1 Return-Path: <schnouki@schnouki.net>
\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 8BF7C431FB6
\r
6 for <notmuch@notmuchmail.org>; Mon, 3 Oct 2011 09:48:48 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5
\r
13 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1]
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id vr1MF-NVFrdd for <notmuch@notmuchmail.org>;
\r
18 Mon, 3 Oct 2011 09:48:46 -0700 (PDT)
\r
19 Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222])
\r
20 by olra.theworths.org (Postfix) with ESMTP id 111D6429E25
\r
21 for <notmuch@notmuchmail.org>; Mon, 3 Oct 2011 09:48:45 -0700 (PDT)
\r
22 Received: from localhost.localdomain (thor.loria.fr [152.81.12.250])
\r
23 by ks3536.kimsufi.com (Postfix) with ESMTPSA id DB15E6A06B2;
\r
24 Mon, 3 Oct 2011 18:48:43 +0200 (CEST)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net;
\r
26 s=key-schnouki; t=1317660523;
\r
27 bh=zoLgJ+GG+rfAESye4oOAFidj0sZ6Fx5hC7howYd/awk=;
\r
28 h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:
\r
29 In-Reply-To:References;
\r
30 b=BJVU4t5FkGB5mGJRHHLMLCu4oc9lSQ6O9YFvZT8HemngIcrxrl00ijTcw8FxD25Xc
\r
31 NoffHZphqo1nQHOOymj3Wbm7n0+C5j6yeccxlCJx/NqfyuHBQMXMQVU9s/Xx+0R2Qs
\r
32 S/2xVetoxJN9+lQEto3TMAcv9M1HXjDfN2jhob4w=
\r
33 From: Thomas Jost <schnouki@schnouki.net>
\r
34 To: notmuch@notmuchmail.org
\r
35 Subject: [PATCH 04/13] test: add 'Emacs' prereq to dependent 'emacs' tests
\r
36 Date: Mon, 3 Oct 2011 18:47:18 +0200
\r
37 Message-Id: <1317660447-27520-5-git-send-email-schnouki@schnouki.net>
\r
38 X-Mailer: git-send-email 1.7.6.4
\r
39 In-Reply-To: <1317660447-27520-1-git-send-email-schnouki@schnouki.net>
\r
40 References: <1317660447-27520-1-git-send-email-schnouki@schnouki.net>
\r
41 In-Reply-To: <871uuuywtt.fsf@convex-new.cs.unb.ca>
\r
42 References: <871uuuywtt.fsf@convex-new.cs.unb.ca>
\r
43 X-BeenThere: notmuch@notmuchmail.org
\r
44 X-Mailman-Version: 2.1.13
\r
46 List-Id: "Use and development of the notmuch mail system."
\r
47 <notmuch.notmuchmail.org>
\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
51 List-Post: <mailto:notmuch@notmuchmail.org>
\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
54 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
55 X-List-Received-Date: Mon, 03 Oct 2011 16:48:48 -0000
\r
57 From: Pieter Praet <pieter@praet.org>
\r
59 Adds a new test that checks for the presence of 'emacs',
\r
60 and adds that test as a prereq to all subsequent tests
\r
63 This causes tests with unmet dependencies to be skipped.
\r
65 Signed-off-by: Pieter Praet <pieter@praet.org>
\r
67 test/emacs | 71 ++++++++++++++++++++++++++++++++---------------------------
\r
68 1 files changed, 38 insertions(+), 33 deletions(-)
\r
70 diff --git a/test/emacs b/test/emacs
\r
71 index 8b627c7..50958ec 100755
\r
75 test_description="emacs interface"
\r
78 +# Emacs is a prereq.
\r
79 +test_set_bin_prereq screen "GNU Screen" SCREEN
\r
80 +test_have_prereq SCREEN && test_set_bin_prereq emacs "Emacs" EMACS
\r
83 EXPECTED=$TEST_DIRECTORY/emacs.expected-output
\r
86 @@ -10,7 +15,7 @@ add_email_corpus
\r
87 test_begin_subtest "Basic notmuch-hello view in emacs"
\r
88 test_emacs '(notmuch-hello)
\r
90 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello
\r
91 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-hello
\r
93 test_begin_subtest "Saved search with 0 results"
\r
94 test_emacs '(let ((notmuch-show-empty-saved-searches t)
\r
95 @@ -20,20 +25,20 @@ test_emacs '(let ((notmuch-show-empty-saved-searches t)
\r
96 ("empty" . "tag:doesnotexist"))))
\r
99 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-with-empty
\r
100 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-hello-with-empty
\r
102 test_begin_subtest "No saved searches displayed (all with 0 results)"
\r
103 test_emacs '(let ((notmuch-saved-searches
\r
104 '\''(("empty" . "tag:doesnotexist"))))
\r
107 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-no-saved-searches
\r
108 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-hello-no-saved-searches
\r
110 test_begin_subtest "Basic notmuch-search view in emacs"
\r
111 test_emacs '(notmuch-search "tag:inbox")
\r
112 (notmuch-test-wait)
\r
114 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-search-tag-inbox
\r
115 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-search-tag-inbox
\r
117 test_begin_subtest "Navigation of notmuch-hello to search results"
\r
118 test_emacs '(notmuch-hello)
\r
119 @@ -42,13 +47,13 @@ test_emacs '(notmuch-hello)
\r
120 (widget-button-press (point))
\r
121 (notmuch-test-wait)
\r
123 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-view-inbox
\r
124 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-hello-view-inbox
\r
126 test_begin_subtest "Basic notmuch-show view in emacs"
\r
127 maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
\r
128 test_emacs "(notmuch-show \"$maildir_storage_thread\")
\r
130 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
\r
131 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
\r
133 test_begin_subtest "notmuch-show for message with invalid From"
\r
134 add_message "[subject]=\"message-with-invalid-from\"" \
\r
135 @@ -64,7 +69,7 @@ Date: Tue, 05 Jan 2001 15:43:57 -0000
\r
137 This is just a test message (#1)
\r
139 -test_expect_equal_file OUTPUT EXPECTED
\r
140 +test_expect_equal_file EMACS OUTPUT EXPECTED
\r
142 test_begin_subtest "Navigation of notmuch-search to thread view"
\r
143 test_emacs '(notmuch-search "tag:inbox")
\r
144 @@ -74,7 +79,7 @@ test_emacs '(notmuch-search "tag:inbox")
\r
145 (notmuch-search-show-thread)
\r
146 (notmuch-test-wait)
\r
148 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
\r
149 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
\r
151 test_begin_subtest "Add tag from search view"
\r
152 os_x_darwin_thread=$(notmuch search --output=threads id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com)
\r
153 @@ -82,26 +87,26 @@ test_emacs "(notmuch-search \"$os_x_darwin_thread\")
\r
154 (notmuch-test-wait)
\r
155 (notmuch-search-add-tag \"tag-from-search-view\")"
\r
156 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
\r
157 -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
158 +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
160 test_begin_subtest "Remove tag from search view"
\r
161 test_emacs "(notmuch-search \"$os_x_darwin_thread\")
\r
162 (notmuch-test-wait)
\r
163 (notmuch-search-remove-tag \"tag-from-search-view\")"
\r
164 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
\r
165 -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
166 +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
168 test_begin_subtest "Add tag from notmuch-show view"
\r
169 test_emacs "(notmuch-show \"$os_x_darwin_thread\")
\r
170 (notmuch-show-add-tag \"tag-from-show-view\")"
\r
171 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
\r
172 -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
173 +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
175 test_begin_subtest "Remove tag from notmuch-show view"
\r
176 test_emacs "(notmuch-show \"$os_x_darwin_thread\")
\r
177 (notmuch-show-remove-tag \"tag-from-show-view\")"
\r
178 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
\r
179 -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
180 +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
182 test_begin_subtest "Message with .. in Message-Id:"
\r
183 add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"'
\r
184 @@ -116,10 +121,10 @@ test_emacs '(notmuch-search "id:\"123..456@example\"")
\r
185 (notmuch-show-add-tag "show-remove")
\r
186 (notmuch-show-remove-tag "show-remove")'
\r
187 output=$(notmuch search 'id:"123..456@example"' | notmuch_search_sanitize)
\r
188 -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
189 +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
191 test_begin_subtest "Sending a message via (fake) SMTP"
\r
192 -emacs_deliver_message \
\r
193 +test_have_prereq EMACS && emacs_deliver_message \
\r
194 'Testing message sent via SMTP' \
\r
195 'This is a test that messages are sent via SMTP' \
\r
197 @@ -140,12 +145,12 @@ Content-Type: text/plain; charset=us-ascii
\r
199 This is a test that messages are sent via SMTP
\r
201 -test_expect_equal_file OUTPUT EXPECTED
\r
202 +test_expect_equal_file EMACS OUTPUT EXPECTED
\r
204 test_begin_subtest "Verify that sent messages are saved/searchable (via FCC)"
\r
205 notmuch new > /dev/null
\r
206 output=$(notmuch search 'subject:"testing message sent via SMTP"' | notmuch_search_sanitize)
\r
207 -test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; Testing message sent via SMTP (inbox)"
\r
208 +test_expect_equal EMACS "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; Testing message sent via SMTP (inbox)"
\r
210 test_begin_subtest "notmuch-fcc-dirs set to nil"
\r
211 test_emacs "(let ((notmuch-fcc-dirs nil))
\r
212 @@ -157,7 +162,7 @@ To:
\r
214 --text follows this line--
\r
216 -test_expect_equal_file OUTPUT EXPECTED
\r
217 +test_expect_equal_file EMACS OUTPUT EXPECTED
\r
219 # Make another FCC maildir specific for the next test
\r
220 mkdir -p mail/sent-string/cur
\r
221 @@ -175,7 +180,7 @@ Subject:
\r
222 Fcc: ${MAIL_DIR}/sent-string
\r
223 --text follows this line--
\r
225 -test_expect_equal_file OUTPUT EXPECTED
\r
226 +test_expect_equal_file EMACS OUTPUT EXPECTED
\r
228 # Make more FCC maildirs specific for the next test
\r
229 mkdir -p mail/sent-list-match/cur
\r
230 @@ -198,7 +203,7 @@ Subject:
\r
231 Fcc: ${MAIL_DIR}/sent-list-match
\r
232 --text follows this line--
\r
234 -test_expect_equal_file OUTPUT EXPECTED
\r
235 +test_expect_equal_file EMACS OUTPUT EXPECTED
\r
237 # Make another FCC maildir specific for the next test
\r
238 mkdir -p mail/sent-list-catch-all/cur
\r
239 @@ -218,7 +223,7 @@ Subject:
\r
240 Fcc: ${MAIL_DIR}/sent-list-catch-all
\r
241 --text follows this line--
\r
243 -test_expect_equal_file OUTPUT EXPECTED
\r
244 +test_expect_equal_file EMACS OUTPUT EXPECTED
\r
246 test_begin_subtest "notmuch-fcc-dirs set to a list (no match)"
\r
247 test_emacs "(let ((notmuch-fcc-dirs
\r
248 @@ -232,14 +237,14 @@ To:
\r
250 --text follows this line--
\r
252 -test_expect_equal_file OUTPUT EXPECTED
\r
253 +test_expect_equal_file EMACS OUTPUT EXPECTED
\r
255 test_begin_subtest "Reply within emacs"
\r
256 test_emacs '(notmuch-search "subject:\"testing message sent via SMTP\"")
\r
257 (notmuch-test-wait)
\r
258 (notmuch-search-reply-to-thread)
\r
260 -sed -i -e 's/^In-Reply-To: <.*>$/In-Reply-To: <XXX>/' OUTPUT
\r
261 +sed -i -e 's/^In-Reply-To: <.*>$/In-Reply-To: <XXX>/' EMACS OUTPUT
\r
262 cat <<EOF >EXPECTED
\r
263 From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
264 To: user@example.com
\r
265 @@ -250,26 +255,26 @@ Fcc: $(pwd)/mail/sent
\r
266 On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:
\r
267 > This is a test that messages are sent via SMTP
\r
269 -test_expect_equal_file OUTPUT EXPECTED
\r
270 +test_expect_equal_file EMACS OUTPUT EXPECTED
\r
272 test_begin_subtest "Save attachment from within emacs using notmuch-show-save-attachments"
\r
273 # save as archive to test that Emacs does not re-compress .gz
\r
274 test_emacs '(let ((standard-input "\"attachment1.gz\""))
\r
275 (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")
\r
276 (notmuch-show-save-attachments))' > /dev/null 2>&1
\r
277 -test_expect_equal_file attachment1.gz "$EXPECTED/attachment"
\r
278 +test_expect_equal_file EMACS attachment1.gz "$EXPECTED/attachment"
\r
280 test_begin_subtest "Save attachment from within emacs using notmuch-show-save-part"
\r
281 # save as archive to test that Emacs does not re-compress .gz
\r
282 test_emacs '(let ((standard-input "\"attachment2.gz\""))
\r
283 (notmuch-show-save-part "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com" 5))' > /dev/null 2>&1
\r
284 -test_expect_equal_file attachment2.gz "$EXPECTED/attachment"
\r
285 +test_expect_equal_file EMACS attachment2.gz "$EXPECTED/attachment"
\r
287 test_begin_subtest "View raw message within emacs"
\r
288 test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")
\r
289 (notmuch-show-view-raw-message)
\r
291 -test_expect_equal_file OUTPUT $EXPECTED/raw-message-cf0c4d-52ad0a
\r
292 +test_expect_equal_file EMACS OUTPUT $EXPECTED/raw-message-cf0c4d-52ad0a
\r
294 test_begin_subtest "Hiding/showing signature in notmuch-show view"
\r
295 maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
\r
296 @@ -279,7 +284,7 @@ test_emacs "(notmuch-show \"$maildir_storage_thread\")
\r
297 (search-backward \"Click/Enter to hide.\")
\r
298 (button-activate (button-at (point)))
\r
300 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
\r
301 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
\r
303 test_begin_subtest "Detection and hiding of top-post quoting of message"
\r
304 add_message '[subject]="The problem with top-posting"' \
\r
305 @@ -326,13 +331,13 @@ Thanks for the advice! I will be sure to put it to good use.
\r
308 [ 9-line hidden original message. Click/Enter to show. ]" > EXPECTED
\r
309 -test_expect_equal_file OUTPUT EXPECTED
\r
310 +test_expect_equal_file EMACS OUTPUT EXPECTED
\r
312 test_begin_subtest "Hiding message in notmuch-show view"
\r
313 test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")
\r
314 (notmuch-show-toggle-message)
\r
315 (test-visible-output)'
\r
316 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages
\r
317 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages
\r
319 test_begin_subtest "Hiding message with visible citation in notmuch-show view"
\r
320 test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")
\r
321 @@ -340,12 +345,12 @@ test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.
\r
322 (button-activate (button-at (point)))
\r
323 (notmuch-show-toggle-message)
\r
324 (test-visible-output)'
\r
325 -test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages
\r
326 +test_expect_equal_file EMACS OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages
\r
328 test_begin_subtest 'Hiding message following HTML part'
\r
329 test_subtest_known_broken
\r
330 id='html-message@notmuchmail.org'
\r
331 -emacs_deliver_message \
\r
332 +test_have_prereq EMACS && emacs_deliver_message \
\r
335 "(message-goto-eoh)
\r
336 @@ -353,7 +358,7 @@ emacs_deliver_message \
\r
337 (message-goto-body)
\r
338 (mml-insert-part \"text/html\")
\r
339 (insert \"<body>This is a test HTML message</body>\")"
\r
340 -emacs_deliver_message \
\r
341 +test_have_prereq EMACS && emacs_deliver_message \
\r
342 'Reply to HTML message' \
\r
343 'This is a reply to the test HTML message' \
\r
344 "(message-goto-eoh)
\r
345 @@ -366,6 +371,6 @@ test_emacs "(notmuch-show \"id:$id\") \
\r
346 (notmuch-show-next-message) \
\r
347 (notmuch-show-toggle-message) \
\r
348 (test-visible-output \"EXPECTED\")"
\r
349 -test_expect_equal_file OUTPUT EXPECTED
\r
350 +test_expect_equal_file EMACS OUTPUT EXPECTED
\r