1 Return-Path: <prvs=jrosenthal=7296245fb@jhu.edu>
\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 048A64196F0
\r
6 for <notmuch@notmuchmail.org>; Fri, 30 Apr 2010 12:09:09 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-4.199 tagged_above=-999 required=5
\r
12 tests=[BAYES_00=-1.9, NORMAL_HTTP_TO_IP=0.001, RCVD_IN_DNSWL_MED=-2.3]
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id 6RCETDguDYSr for <notmuch@notmuchmail.org>;
\r
17 Fri, 30 Apr 2010 12:09:04 -0700 (PDT)
\r
18 Received: from ipex2.johnshopkins.edu (ipex2.johnshopkins.edu [162.129.8.151])
\r
19 by olra.theworths.org (Postfix) with ESMTP id 41926431FC1
\r
20 for <notmuch@notmuchmail.org>; Fri, 30 Apr 2010 12:09:04 -0700 (PDT)
\r
21 X-IronPort-AV: E=Sophos;i="4.52,304,1270440000"; d="scan'208";a="326233036"
\r
22 Received: from c-69-255-36-229.hsd1.md.comcast.net (HELO lucky)
\r
24 by ipex2.johnshopkins.edu with ESMTP/TLS/AES256-SHA;
\r
25 30 Apr 2010 15:09:03 -0400
\r
26 Received: from jkr by lucky with local (Exim 4.69)
\r
27 (envelope-from <jrosenthal@jhu.edu>)
\r
28 id 1O7vaA-0004zc-31; Fri, 30 Apr 2010 15:09:02 -0400
\r
29 From: Jesse Rosenthal <jrosenthal@jhu.edu>
\r
30 To: Notmuch developer list <notmuch@notmuchmail.org>
\r
31 Subject: [PATCH 2/2] test: Have notmuch-test use the modular test collections
\r
32 In-Reply-To: <87iq78daii.fsf@jhu.edu>
\r
33 References: <87sk6cdbxz.fsf@jhu.edu> <87iq78daii.fsf@jhu.edu>
\r
34 User-Agent: Notmuch/0.3-23-g5efa9bd (http://notmuchmail.org) Emacs/23.1.1
\r
36 Date: Fri, 30 Apr 2010 15:09:01 -0400
\r
37 Message-ID: <87fx2cdagi.fsf@jhu.edu>
\r
39 Content-Type: text/plain; charset=utf-8
\r
40 Content-Transfer-Encoding: quoted-printable
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Fri, 30 Apr 2010 19:09:09 -0000
\r
55 Introduce two new functions (run_collection_setup_and_tests and
\r
56 run_test_suite) to notmuch-test. The first takes as an argument a subdir
\r
57 of test/tests and runs all .setup and .test files in there in order of
\r
58 their numerical prefix. The latter either runs all tests (if given "all"
\r
59 or no argument) or a given dir (if given it as an argument).
\r
61 Also introduce the variable TEST_COLLECTIONS. These are all the folders
\r
62 that "notmuch-test all" should look for. It won't automatically run all
\r
63 folders, in case there is something that is only relevant in certain
\r
64 circumstances (such as, perhaps, future tests for remote usage).
\r
66 test/notmuch-test | 921 +++----------------------------------------------=
\r
68 1 files changed, 47 insertions(+), 874 deletions(-)
\r
70 diff --git a/test/notmuch-test b/test/notmuch-test
\r
71 index a861df1..29d5c91 100755
\r
72 --- a/test/notmuch-test
\r
73 +++ b/test/notmuch-test
\r
74 @@ -7,6 +7,20 @@ set -e
\r
75 # without regard to the time zone of where the test suite is run.
\r
78 +TEST_COLLECTION_DIR=3D"$(dirname $(readlink -f $0))/tests"
\r
80 +TEST_COLLECTIONS=3D"notmuch-new
\r
86 +notmuch-dump-restore
\r
87 +out-of-order-threading
\r
89 +from-guessing-multiple
\r
90 +from-guessing-single"
\r
92 find_notmuch_binary ()
\r
95 @@ -210,13 +224,15 @@ notmuch_show_sanitize ()
\r
96 sed -e "$NOTMUCH_SHOW_FILENAME_SQUELCH"
\r
102 +initialize_notmuch_test ()
\r
104 + rm -rf ${TEST_DIR}
\r
105 + mkdir ${TEST_DIR}
\r
109 + mkdir ${MAIL_DIR}
\r
111 -cat <<EOF > ${NOTMUCH_CONFIG}
\r
112 + cat <<EOF > ${NOTMUCH_CONFIG}
\r
116 @@ -225,878 +241,35 @@ name=3DNotmuch Test Suite
\r
117 primary_email=3Dtest_suite@notmuchmail.org
\r
118 other_email=3Dtest_suite_other@notmuchmail.org;test_suite@otherdomain.org
\r
122 -printf "Testing \"notmuch new\" in several variations:\n"
\r
123 -printf " No new messages...\t\t\t\t"
\r
124 -output=3D$(NOTMUCH_NEW)
\r
125 -pass_if_equal "$output" "No new mail."
\r
127 -printf " Single new message...\t\t\t\t"
\r
129 -output=3D$(NOTMUCH_NEW)
\r
130 -pass_if_equal "$output" "Added 1 new message to the database."
\r
132 -printf " Multiple new messages...\t\t\t"
\r
135 -output=3D$(NOTMUCH_NEW)
\r
136 -pass_if_equal "$output" "Added 2 new messages to the database."
\r
138 -printf " No new messages (non-empty DB)...\t\t"
\r
139 -output=3D$(NOTMUCH_NEW)
\r
140 -pass_if_equal "$output" "No new mail."
\r
142 -printf " New directories...\t\t\t\t"
\r
143 -rm -rf ${MAIL_DIR}/* ${MAIL_DIR}/.notmuch
\r
144 -mkdir ${MAIL_DIR}/def
\r
145 -mkdir ${MAIL_DIR}/ghi
\r
146 -generate_message [dir]=3Ddef
\r
148 -output=3D$(NOTMUCH_NEW)
\r
149 -pass_if_equal "$output" "Added 1 new message to the database."
\r
151 -printf " Alternate inode order...\t\t\t"
\r
153 -rm -rf ${MAIL_DIR}/.notmuch
\r
154 -mv ${MAIL_DIR}/ghi ${MAIL_DIR}/abc
\r
155 -rm ${MAIL_DIR}/def/*
\r
156 -generate_message [dir]=3Dabc
\r
158 -output=3D$(NOTMUCH_NEW)
\r
159 -pass_if_equal "$output" "Added 1 new message to the database."
\r
161 -printf " Message moved in...\t\t\t\t"
\r
162 -rm -rf ${MAIL_DIR}/* ${MAIL_DIR}/.notmuch
\r
164 -tmp_msg_filename=3Dtmp/$gen_msg_filename
\r
165 -mkdir -p $(dirname $tmp_msg_filename)
\r
166 -mv $gen_msg_filename $tmp_msg_filename
\r
167 -increment_mtime ${MAIL_DIR}
\r
168 -$NOTMUCH new > /dev/null
\r
169 -mv $tmp_msg_filename $gen_msg_filename
\r
170 -increment_mtime ${MAIL_DIR}
\r
171 -output=3D$(NOTMUCH_NEW)
\r
172 -pass_if_equal "$output" "Added 1 new message to the database."
\r
174 -printf " Renamed message...\t\t\t\t"
\r
177 -$NOTMUCH new > /dev/null
\r
178 -mv $gen_msg_filename ${gen_msg_filename}-renamed
\r
179 -increment_mtime ${MAIL_DIR}
\r
180 -output=3D$(NOTMUCH_NEW)
\r
181 -pass_if_equal "$output" "No new mail. Detected 1 file rename."
\r
183 -printf " Deleted message...\t\t\t\t"
\r
185 -rm ${gen_msg_filename}-renamed
\r
186 -increment_mtime ${MAIL_DIR}
\r
187 -output=3D$(NOTMUCH_NEW)
\r
188 -pass_if_equal "$output" "No new mail. Removed 1 message."
\r
190 -printf " Renamed directory...\t\t\t\t"
\r
192 -generate_message [dir]=3Ddir
\r
193 -generate_message [dir]=3Ddir
\r
194 -generate_message [dir]=3Ddir
\r
196 -$NOTMUCH new > /dev/null
\r
198 -mv ${MAIL_DIR}/dir ${MAIL_DIR}/dir-renamed
\r
199 -increment_mtime ${MAIL_DIR}
\r
201 -output=3D$(NOTMUCH_NEW)
\r
202 -pass_if_equal "$output" "No new mail. Detected 3 file renames."
\r
204 -printf " Deleted directory...\t\t\t\t"
\r
206 -rm -rf ${MAIL_DIR}/dir-renamed
\r
207 -increment_mtime ${MAIL_DIR}
\r
209 -output=3D$(NOTMUCH_NEW)
\r
210 -pass_if_equal "$output" "No new mail. Removed 3 messages."
\r
212 -printf " New directory (at end of list)...\t\t"
\r
214 -generate_message [dir]=3Dzzz
\r
215 -generate_message [dir]=3Dzzz
\r
216 -generate_message [dir]=3Dzzz
\r
218 -output=3D$(NOTMUCH_NEW)
\r
219 -pass_if_equal "$output" "Added 3 new messages to the database."
\r
221 -printf " Deleted directory (end of list)...\t\t"
\r
223 -rm -rf ${MAIL_DIR}/zzz
\r
224 -increment_mtime ${MAIL_DIR}
\r
226 -output=3D$(NOTMUCH_NEW)
\r
227 -pass_if_equal "$output" "No new mail. Removed 3 messages."
\r
229 -printf " New symlink to directory...\t\t\t"
\r
231 -rm -rf ${MAIL_DIR}/.notmuch
\r
232 -mv ${MAIL_DIR} ${TEST_DIR}/actual_maildir
\r
235 -ln -s ${TEST_DIR}/actual_maildir ${MAIL_DIR}/symlink
\r
237 -output=3D$(NOTMUCH_NEW)
\r
238 -pass_if_equal "$output" "Added 1 new message to the database."
\r
240 -printf " New symlink to a file...\t\t\t"
\r
242 -external_msg_filename=3D${TEST_DIR}/external/$(basename $gen_msg_filename)
\r
243 -mkdir -p $(dirname $external_msg_filename)
\r
244 -mv $gen_msg_filename $external_msg_filename
\r
245 -ln -s $external_msg_filename $gen_msg_filename
\r
246 -increment_mtime ${MAIL_DIR}
\r
247 -output=3D$(NOTMUCH_NEW)
\r
248 -pass_if_equal "$output" "Added 1 new message to the database."
\r
250 -printf " New two-level directory...\t\t\t"
\r
252 -generate_message [dir]=3Dtwo/levels
\r
253 -generate_message [dir]=3Dtwo/levels
\r
254 -generate_message [dir]=3Dtwo/levels
\r
256 -output=3D$(NOTMUCH_NEW)
\r
257 -pass_if_equal "$output" "Added 3 new messages to the database."
\r
259 -printf " Deleted two-level directory...\t\t\t"
\r
261 -rm -rf ${MAIL_DIR}/two
\r
262 -increment_mtime ${MAIL_DIR}
\r
264 -output=3D$(NOTMUCH_NEW)
\r
265 -pass_if_equal "$output" "No new mail. Removed 3 messages."
\r
267 -printf "\nTesting \"notmuch search\" in several variations:\n"
\r
269 -printf " Search body...\t\t\t\t\t"
\r
270 -add_message '[subject]=3D"body search"' '[date]=3D"Sat, 01 Jan 2000 12:00:=
\r
271 00 -0000"' [body]=3Dbodysearchtest
\r
272 -output=3D$($NOTMUCH search bodysearchtest | notmuch_search_sanitize)
\r
273 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;=
\r
274 body search (inbox unread)"
\r
276 -printf " Search by from:...\t\t\t\t"
\r
277 -add_message '[subject]=3D"search by from"' '[date]=3D"Sat, 01 Jan 2000 12:=
\r
278 00:00 -0000"' [from]=3Dsearchbyfrom
\r
279 -output=3D$($NOTMUCH search from:searchbyfrom | notmuch_search_sanitize)
\r
280 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] searchbyfrom; searc=
\r
281 h by from (inbox unread)"
\r
283 -printf " Search by to:...\t\t\t\t"
\r
284 -add_message '[subject]=3D"search by to"' '[date]=3D"Sat, 01 Jan 2000 12:00=
\r
285 :00 -0000"' [to]=3Dsearchbyto
\r
286 -output=3D$($NOTMUCH search to:searchbyto | notmuch_search_sanitize)
\r
287 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;=
\r
288 search by to (inbox unread)"
\r
290 -printf " Search by subject:...\t\t\t\t"
\r
291 -add_message [subject]=3Dsubjectsearchtest '[date]=3D"Sat, 01 Jan 2000 12:0=
\r
293 -output=3D$($NOTMUCH search subject:subjectsearchtest | notmuch_search_sani=
\r
295 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;=
\r
296 subjectsearchtest (inbox unread)"
\r
298 -printf " Search by id:...\t\t\t\t"
\r
299 -add_message '[subject]=3D"search by id"' '[date]=3D"Sat, 01 Jan 2000 12:00=
\r
301 -output=3D$($NOTMUCH search id:${gen_msg_id} | notmuch_search_sanitize)
\r
302 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;=
\r
303 search by id (inbox unread)"
\r
305 -printf " Search by tag:...\t\t\t\t"
\r
306 -add_message '[subject]=3D"search by tag"' '[date]=3D"Sat, 01 Jan 2000 12:0=
\r
308 -$NOTMUCH tag +searchbytag id:${gen_msg_id}
\r
309 -output=3D$($NOTMUCH search tag:searchbytag | notmuch_search_sanitize)
\r
310 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;=
\r
311 search by tag (inbox searchbytag unread)"
\r
313 -printf " Search by thread:...\t\t\t\t"
\r
314 -add_message '[subject]=3D"search by thread"' '[date]=3D"Sat, 01 Jan 2000 1=
\r
316 -thread_id=3D$($NOTMUCH search id:${gen_msg_id} | sed -e 's/thread:\([a-f0-=
\r
318 -output=3D$($NOTMUCH search thread:${thread_id} | notmuch_search_sanitize)
\r
319 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;=
\r
320 search by thread (inbox unread)"
\r
322 -printf " Search body (phrase)...\t\t\t"
\r
323 -add_message '[subject]=3D"body search (phrase)"' '[date]=3D"Sat, 01 Jan 20=
\r
324 00 12:00:00 -0000"' '[body]=3D"body search (phrase)"'
\r
325 -add_message '[subject]=3D"negative result"' '[date]=3D"Sat, 01 Jan 2000 12=
\r
326 :00:00 -0000"' '[body]=3D"This phrase should not match the body search"'
\r
327 -output=3D$($NOTMUCH search '\"body search (phrase)\"' | notmuch_search_san=
\r
329 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;=
\r
330 body search (phrase) (inbox unread)"
\r
332 -printf " Search by from: (address)...\t\t\t"
\r
333 -add_message '[subject]=3D"search by from (address)"' '[date]=3D"Sat, 01 Ja=
\r
334 n 2000 12:00:00 -0000"' [from]=3Dsearchbyfrom@example.com
\r
335 -output=3D$($NOTMUCH search from:searchbyfrom@example.com | notmuch_search_=
\r
337 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] searchbyfrom@exampl=
\r
338 e.com; search by from (address) (inbox unread)"
\r
340 -printf " Search by from: (name)...\t\t\t"
\r
341 -add_message '[subject]=3D"search by from (name)"' '[date]=3D"Sat, 01 Jan 2=
\r
342 000 12:00:00 -0000"' '[from]=3D"Search By From Name <test@example.com>"'
\r
343 -output=3D$($NOTMUCH search from:'Search By From Name' | notmuch_search_san=
\r
345 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Search By From Name=
\r
346 ; search by from (name) (inbox unread)"
\r
348 -printf " Search by to: (address)...\t\t\t"
\r
349 -add_message '[subject]=3D"search by to (address)"' '[date]=3D"Sat, 01 Jan =
\r
350 2000 12:00:00 -0000"' [to]=3Dsearchbyto@example.com
\r
351 -output=3D$($NOTMUCH search to:searchbyto@example.com | notmuch_search_sani=
\r
353 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;=
\r
354 search by to (address) (inbox unread)"
\r
356 -printf " Search by to: (name)...\t\t\t"
\r
357 -add_message '[subject]=3D"search by to (name)"' '[date]=3D"Sat, 01 Jan 200=
\r
358 0 12:00:00 -0000"' '[to]=3D"Search By To Name <test@example.com>"'
\r
359 -output=3D$($NOTMUCH search to:'Search By To Name' | notmuch_search_sanitiz=
\r
361 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;=
\r
362 search by to (name) (inbox unread)"
\r
364 -printf " Search by subject: (phrase)...\t\t\t"
\r
365 -add_message '[subject]=3D"subject search test (phrase)"' '[date]=3D"Sat, 0=
\r
366 1 Jan 2000 12:00:00 -0000"'
\r
367 -add_message '[subject]=3D"this phrase should not match the subject search =
\r
368 test"' '[date]=3D"Sat, 01 Jan 2000 12:00:00 -0000"'
\r
369 -output=3D$($NOTMUCH search 'subject:\"subject search test (phrase)\"' | no=
\r
370 tmuch_search_sanitize)
\r
371 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;=
\r
372 subject search test (phrase) (inbox unread)"
\r
374 -printf " Search for all messages (\"*\"):...\t\t"
\r
375 -output=3D$($NOTMUCH search '*' | notmuch_search_sanitize)
\r
376 -pass_if_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite;=
\r
377 Test message #6 (inbox unread)
\r
378 -thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Test message #14 (inbox =
\r
380 -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (inbox unrea=
\r
382 -thread:XXX 2000-01-01 [1/1] searchbyfrom; search by from (inbox unread)
\r
383 -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (inbox unre=
\r
385 -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subjectsearchtest (inbox=
\r
387 -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by id (inbox unre=
\r
389 -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by tag (inbox sea=
\r
391 -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by thread (inbox =
\r
393 -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (phrase) (in=
\r
395 -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; negative result (inbox u=
\r
397 -thread:XXX 2000-01-01 [1/1] searchbyfrom@example.com; search by from (ad=
\r
398 dress) (inbox unread)
\r
399 -thread:XXX 2000-01-01 [1/1] Search By From Name; search by from (name) (=
\r
401 -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (address) (=
\r
403 -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (name) (inb=
\r
405 -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subject search test (phr=
\r
406 ase) (inbox unread)
\r
407 -thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; this phrase should not m=
\r
408 atch the subject search test (inbox unread)"
\r
410 -printf " Search body (utf-8):...\t\t\t"
\r
411 -add_message '[subject]=3D"utf8-message-body-subject"' '[date]=3D"Sat, 01 J=
\r
412 an 2000 12:00:00 -0000"' '[body]=3D"message body utf8: b=C3=B6d=C3=BD"'
\r
413 -output=3D$($NOTMUCH search 'b=C3=B6d=C3=BD' | notmuch_search_sanitize)
\r
414 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;=
\r
415 utf8-message-body-subject (inbox unread)"
\r
417 -printf "\nTesting --format=3Djson output:\n"
\r
419 -printf " Show message: json...\t\t\t\t"
\r
420 -add_message '[subject]=3D"json-show-subject"' '[date]=3D"Sat, 01 Jan 2000 =
\r
421 12:00:00 -0000"' '[body]=3D"json-show-message"'
\r
422 -output=3D$($NOTMUCH show --format=3Djson 'json-show-message')
\r
423 -pass_if_equal "$output" '[[[{"id": "'${gen_msg_id}'", "match": true, "file=
\r
424 name": "'${gen_msg_filename}'", "timestamp": 946728000, "date_relative": "2=
\r
425 000-01-01", "tags": ["inbox","unread"], "headers": {"Subject": "json-show-s=
\r
426 ubject", "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", "To": "=
\r
427 Notmuch Test Suite <test_suite@notmuchmail.org>", "Cc": "", "Bcc": "", "Dat=
\r
428 e": "Sat, 01 Jan 2000 12:00:00 -0000"}, "body": [{"id": 1, "content-type": =
\r
429 "text/plain", "content": "json-show-message\n"}]}, []]]]'
\r
431 -printf " Search message: json...\t\t\t"
\r
432 -add_message '[subject]=3D"json-search-subject"' '[date]=3D"Sat, 01 Jan 200=
\r
433 0 12:00:00 -0000"' '[body]=3D"json-search-message"'
\r
434 -output=3D$($NOTMUCH search --format=3Djson 'json-search-message' | notmuch=
\r
436 -pass_if_equal "$output" '[{"thread": "XXX",
\r
437 -"timestamp": 946728000,
\r
440 -"authors": "Notmuch Test Suite",
\r
441 -"subject": "json-search-subject",
\r
442 -"tags": ["inbox", "unread"]}]'
\r
444 -printf " Search by subject (utf-8):...\t\t\t"
\r
445 -add_message [subject]=3Dutf8-s=C3=BCbj=C3=A9ct '[date]=3D"Sat, 01 Jan 2000=
\r
447 -output=3D$($NOTMUCH search subject:utf8-s=C3=BCbj=C3=A9ct | notmuch_search=
\r
449 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;=
\r
450 utf8-s=C3=BCbj=C3=A9ct (inbox unread)"
\r
452 -printf " Show message: json, utf-8...\t\t\t"
\r
453 -add_message '[subject]=3D"json-show-utf8-body-s=C3=BCbj=C3=A9ct"' '[date]=
\r
454 =3D"Sat, 01 Jan 2000 12:00:00 -0000"' '[body]=3D"js=C3=B6n-show-m=C3=A9ssag=
\r
456 -output=3D$($NOTMUCH show --format=3Djson 'js=C3=B6n-show-m=C3=A9ssage')
\r
457 -pass_if_equal "$output" '[[[{"id": "'${gen_msg_id}'", "match": true, "file=
\r
458 name": "'${gen_msg_filename}'", "timestamp": 946728000, "date_relative": "2=
\r
459 000-01-01", "tags": ["inbox","unread"], "headers": {"Subject": "json-show-u=
\r
460 tf8-body-s=C3=BCbj=C3=A9ct", "From": "Notmuch Test Suite <test_suite@notmuc=
\r
461 hmail.org>", "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", "Cc":=
\r
462 "", "Bcc": "", "Date": "Sat, 01 Jan 2000 12:00:00 -0000"}, "body": [{"id":=
\r
463 1, "content-type": "text/plain", "content": "js=C3=B6n-show-m=C3=A9ssage\n=
\r
466 -printf " Search message: json, utf-8...\t\t\t"
\r
467 -add_message '[subject]=3D"json-search-utf8-body-s=C3=BCbj=C3=A9ct"' '[date=
\r
468 ]=3D"Sat, 01 Jan 2000 12:00:00 -0000"' '[body]=3D"js=C3=B6n-search-m=C3=A9s=
\r
470 -output=3D$($NOTMUCH search --format=3Djson 'js=C3=B6n-search-m=C3=A9ssage'=
\r
471 | notmuch_search_sanitize)
\r
472 -pass_if_equal "$output" '[{"thread": "XXX",
\r
473 -"timestamp": 946728000,
\r
476 -"authors": "Notmuch Test Suite",
\r
477 -"subject": "json-search-utf8-body-s=C3=BCbj=C3=A9ct",
\r
478 -"tags": ["inbox", "unread"]}]'
\r
480 -printf "\nTesting naming of threads with changing subject:\n"
\r
481 -add_message '[subject]=3D"thread-naming: Initial thread subject"' \
\r
482 - '[date]=3D"Fri, 05 Jan 2001 15:43:56 -0800"'
\r
483 -first=3D${gen_msg_cnt}
\r
484 -parent=3D${gen_msg_id}
\r
485 -add_message '[subject]=3D"thread-naming: Older changed subject"' \
\r
486 - '[date]=3D"Sat, 06 Jan 2001 15:43:56 -0800"' \
\r
487 - "[in-reply-to]=3D\<$parent\>"
\r
488 -add_message '[subject]=3D"thread-naming: Newer changed subject"' \
\r
489 - '[date]=3D"Sun, 07 Jan 2001 15:43:56 -0800"' \
\r
490 - "[in-reply-to]=3D\<$parent\>"
\r
491 -add_message '[subject]=3D"thread-naming: Final thread subject"' \
\r
492 - '[date]=3D"Mon, 08 Jan 2001 15:43:56 -0800"' \
\r
493 - "[in-reply-to]=3D\<$parent\>"
\r
494 -final=3D${gen_msg_id}
\r
496 -printf " Initial thread name (oldest-first search)...\t"
\r
497 -output=3D$($NOTMUCH search --sort=3Doldest-first thread-naming and tag:inb=
\r
498 ox | notmuch_search_sanitize)
\r
499 -pass_if_equal "$output" "thread:XXX 2001-01-05 [4/4] Notmuch Test Suite;=
\r
500 thread-naming: Initial thread subject (inbox unread)"
\r
502 -printf " Initial thread name (newest-first search)...\t"
\r
503 -output=3D$($NOTMUCH search --sort=3Dnewest-first thread-naming and tag:inb=
\r
504 ox | notmuch_search_sanitize)
\r
505 -pass_if_equal "$output" "thread:XXX 2001-01-08 [4/4] Notmuch Test Suite;=
\r
506 thread-naming: Final thread subject (inbox unread)"
\r
508 -# Remove oldest and newest messages from search results
\r
509 -$NOTMUCH tag -inbox id:$parent or id:$final
\r
511 -printf " Changed thread name (oldest-first search)...\t"
\r
512 -output=3D$($NOTMUCH search --sort=3Doldest-first thread-naming and tag:inb=
\r
513 ox | notmuch_search_sanitize)
\r
514 -pass_if_equal "$output" "thread:XXX 2001-01-06 [2/4] Notmuch Test Suite;=
\r
515 thread-naming: Older changed subject (inbox unread)"
\r
517 -printf " Changed thread name (newest-first search)...\t"
\r
518 -output=3D$($NOTMUCH search --sort=3Dnewest-first thread-naming and tag:inb=
\r
519 ox | notmuch_search_sanitize)
\r
520 -pass_if_equal "$output" "thread:XXX 2001-01-07 [2/4] Notmuch Test Suite;=
\r
521 thread-naming: Newer changed subject (inbox unread)"
\r
523 -printf " Ignore added reply prefix (Re:)...\t\t"
\r
524 -add_message '[subject]=3D"Re: thread-naming: Initial thread subject"' \
\r
525 - '[date]=3D"Tue, 09 Jan 2001 15:43:45 -0800"' \
\r
526 - "[in-reply-to]=3D\<$parent\>"
\r
527 -output=3D$($NOTMUCH search --sort=3Dnewest-first thread-naming and tag:inb=
\r
528 ox | notmuch_search_sanitize)
\r
529 -pass_if_equal "$output" "thread:XXX 2001-01-09 [3/5] Notmuch Test Suite;=
\r
530 thread-naming: Initial thread subject (inbox unread)"
\r
532 -printf " Ignore added reply prefix (Aw:)...\t\t"
\r
533 -add_message '[subject]=3D"Aw: thread-naming: Initial thread subject"' \
\r
534 - '[date]=3D"Wed, 10 Jan 2001 15:43:45 -0800"' \
\r
535 - "[in-reply-to]=3D\<$parent\>"
\r
536 -output=3D$($NOTMUCH search --sort=3Dnewest-first thread-naming and tag:inb=
\r
537 ox | notmuch_search_sanitize)
\r
538 -pass_if_equal "$output" "thread:XXX 2001-01-10 [4/6] Notmuch Test Suite;=
\r
539 thread-naming: Initial thread subject (inbox unread)"
\r
541 -printf " Ignore added reply prefix (Vs:)...\t\t"
\r
542 -add_message '[subject]=3D"Vs: thread-naming: Initial thread subject"' \
\r
543 - '[date]=3D"Thu, 11 Jan 2001 15:43:45 -0800"' \
\r
544 - "[in-reply-to]=3D\<$parent\>"
\r
545 -output=3D$($NOTMUCH search --sort=3Dnewest-first thread-naming and tag:inb=
\r
546 ox | notmuch_search_sanitize)
\r
547 -pass_if_equal "$output" "thread:XXX 2001-01-11 [5/7] Notmuch Test Suite;=
\r
548 thread-naming: Initial thread subject (inbox unread)"
\r
550 -printf " Ignore added reply prefix (Sv:)...\t\t"
\r
551 -add_message '[subject]=3D"Sv: thread-naming: Initial thread subject"' \
\r
552 - '[date]=3D"Fri, 12 Jan 2001 15:43:45 -0800"' \
\r
553 - "[in-reply-to]=3D\<$parent\>"
\r
554 -output=3D$($NOTMUCH search --sort=3Dnewest-first thread-naming and tag:inb=
\r
555 ox | notmuch_search_sanitize)
\r
556 -pass_if_equal "$output" "thread:XXX 2001-01-12 [6/8] Notmuch Test Suite;=
\r
557 thread-naming: Initial thread subject (inbox unread)"
\r
559 -printf " Test order of messages in \"notmuch show\"\t"
\r
560 -output=3D$($NOTMUCH show thread-naming | notmuch_show_sanitize)
\r
561 -pass_if_equal "$output" "
\f\r
562 message{ id:msg-$(printf "%03d" $first)@notmuch-=
\r
563 test-suite depth:0 match:1 filename:/XXX/mail/msg-$(printf "%03d" $first)
\r
566 -Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (unread)
\r
567 -Subject: thread-naming: Initial thread subject
\r
568 -From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
569 -To: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
570 -Date: Fri, 05 Jan 2001 15:43:56 -0800
\r
576 part{ ID: 1, Content-type: text/plain
\r
577 -This is just a test message (#$first)
\r
585 message{ id:msg-$(printf "%03d" $((first + 1)))@notmuch-test-suite depth:=
\r
586 1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 1)))
\r
589 -Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-06) (inbox unread)
\r
590 -Subject: thread-naming: Older changed subject
\r
591 -From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
592 -To: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
593 -Date: Sat, 06 Jan 2001 15:43:56 -0800
\r
599 part{ ID: 1, Content-type: text/plain
\r
600 -This is just a test message (#$((first + 1)))
\r
608 message{ id:msg-$(printf "%03d" $((first + 2)))@notmuch-test-suite depth:=
\r
609 1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 2)))
\r
612 -Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-07) (inbox unread)
\r
613 -Subject: thread-naming: Newer changed subject
\r
614 -From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
615 -To: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
616 -Date: Sun, 07 Jan 2001 15:43:56 -0800
\r
622 part{ ID: 1, Content-type: text/plain
\r
623 -This is just a test message (#$((first + 2)))
\r
631 message{ id:msg-$(printf "%03d" $((first + 3)))@notmuch-test-suite depth:=
\r
632 1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 3)))
\r
635 -Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-08) (unread)
\r
636 -Subject: thread-naming: Final thread subject
\r
637 -From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
638 -To: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
639 -Date: Mon, 08 Jan 2001 15:43:56 -0800
\r
645 part{ ID: 1, Content-type: text/plain
\r
646 -This is just a test message (#$((first + 3)))
\r
654 message{ id:msg-$(printf "%03d" $((first + 4)))@notmuch-test-suite depth:=
\r
655 1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 4)))
\r
658 -Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-09) (inbox unread)
\r
659 -Subject: Re: thread-naming: Initial thread subject
\r
660 -From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
661 -To: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
662 -Date: Tue, 09 Jan 2001 15:43:45 -0800
\r
668 part{ ID: 1, Content-type: text/plain
\r
669 -This is just a test message (#$((first + 4)))
\r
677 message{ id:msg-$(printf "%03d" $((first + 5)))@notmuch-test-suite depth:=
\r
678 1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 5)))
\r
681 -Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-10) (inbox unread)
\r
682 -Subject: Aw: thread-naming: Initial thread subject
\r
683 -From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
684 -To: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
685 -Date: Wed, 10 Jan 2001 15:43:45 -0800
\r
691 part{ ID: 1, Content-type: text/plain
\r
692 -This is just a test message (#$((first + 5)))
\r
700 message{ id:msg-$(printf "%03d" $((first + 6)))@notmuch-test-suite depth:=
\r
701 1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 6)))
\r
704 -Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-11) (inbox unread)
\r
705 -Subject: Vs: thread-naming: Initial thread subject
\r
706 -From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
707 -To: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
708 -Date: Thu, 11 Jan 2001 15:43:45 -0800
\r
714 part{ ID: 1, Content-type: text/plain
\r
715 -This is just a test message (#$((first + 6)))
\r
723 message{ id:msg-$(printf "%03d" $((first + 7)))@notmuch-test-suite depth:=
\r
724 1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 7)))
\r
727 -Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-12) (inbox unread)
\r
728 -Subject: Sv: thread-naming: Initial thread subject
\r
729 -From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
730 -To: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
731 -Date: Fri, 12 Jan 2001 15:43:45 -0800
\r
737 part{ ID: 1, Content-type: text/plain
\r
738 -This is just a test message (#$((first + 7)))
\r
746 -printf "\nTesting \"notmuch reply\" in several variations:\n"
\r
748 -printf " Basic reply...\t\t\t\t\t"
\r
749 -add_message '[from]=3D"Sender <sender@example.com>"' \
\r
750 - [to]=3Dtest_suite@notmuchmail.org \
\r
751 - [subject]=3Dnotmuch-reply-test \
\r
752 - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \
\r
753 - '[body]=3D"basic reply test"'
\r
755 -output=3D$($NOTMUCH reply id:${gen_msg_id})
\r
756 -pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.=
\r
758 -Subject: Re: notmuch-reply-test
\r
759 -To: Sender <sender@example.com>
\r
760 -Bcc: test_suite@notmuchmail.org
\r
761 -In-Reply-To: <${gen_msg_id}>
\r
762 -References: <${gen_msg_id}>
\r
764 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
\r
765 -> basic reply test"
\r
767 -printf " Multiple recipients...\t\t\t\t"
\r
768 -add_message '[from]=3D"Sender <sender@example.com>"' \
\r
769 - '[to]=3D"test_suite@notmuchmail.org, Someone Else <someone@exa=
\r
771 - [subject]=3Dnotmuch-reply-test \
\r
772 - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \
\r
773 - '[body]=3D"Multiple recipients"'
\r
775 -output=3D$($NOTMUCH reply id:${gen_msg_id})
\r
776 -pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.=
\r
778 -Subject: Re: notmuch-reply-test
\r
779 -To: Sender <sender@example.com>, Someone Else <someone@example.com>
\r
780 -Bcc: test_suite@notmuchmail.org
\r
781 -In-Reply-To: <${gen_msg_id}>
\r
782 -References: <${gen_msg_id}>
\r
784 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
\r
785 -> Multiple recipients"
\r
787 -printf " Reply with CC...\t\t\t\t"
\r
788 -add_message '[from]=3D"Sender <sender@example.com>"' \
\r
789 - [to]=3Dtest_suite@notmuchmail.org \
\r
790 - '[cc]=3D"Other Parties <cc@example.com>"' \
\r
791 - [subject]=3Dnotmuch-reply-test \
\r
792 - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \
\r
793 - '[body]=3D"reply with CC"'
\r
795 -output=3D$($NOTMUCH reply id:${gen_msg_id})
\r
796 -pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.=
\r
798 -Subject: Re: notmuch-reply-test
\r
799 -To: Sender <sender@example.com>
\r
800 -Cc: Other Parties <cc@example.com>
\r
801 -Bcc: test_suite@notmuchmail.org
\r
802 -In-Reply-To: <${gen_msg_id}>
\r
803 -References: <${gen_msg_id}>
\r
805 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
\r
808 -printf " Reply from alternate address...\t\t"
\r
809 -add_message '[from]=3D"Sender <sender@example.com>"' \
\r
810 - [to]=3Dtest_suite_other@notmuchmail.org \
\r
811 - [subject]=3Dnotmuch-reply-test \
\r
812 - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \
\r
813 - '[body]=3D"reply from alternate address"'
\r
815 -output=3D$($NOTMUCH reply id:${gen_msg_id})
\r
816 -pass_if_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuc=
\r
818 -Subject: Re: notmuch-reply-test
\r
819 -To: Sender <sender@example.com>
\r
820 -Bcc: test_suite@notmuchmail.org
\r
821 -In-Reply-To: <${gen_msg_id}>
\r
822 -References: <${gen_msg_id}>
\r
824 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
\r
825 -> reply from alternate address"
\r
827 -printf " Support for Reply-To...\t\t\t"
\r
828 -add_message '[from]=3D"Sender <sender@example.com>"' \
\r
829 - [to]=3Dtest_suite@notmuchmail.org \
\r
830 - [subject]=3Dnotmuch-reply-test \
\r
831 - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \
\r
832 - '[body]=3D"support for reply-to"' \
\r
833 - '[reply-to]=3D"Sender <elsewhere@example.com>"'
\r
835 -output=3D$($NOTMUCH reply id:${gen_msg_id})
\r
836 -pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.=
\r
838 -Subject: Re: notmuch-reply-test
\r
839 -To: Sender <elsewhere@example.com>
\r
840 -Bcc: test_suite@notmuchmail.org
\r
841 -In-Reply-To: <${gen_msg_id}>
\r
842 -References: <${gen_msg_id}>
\r
844 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
\r
845 -> support for reply-to"
\r
847 -printf " Un-munging Reply-To...\t\t\t\t"
\r
848 -add_message '[from]=3D"Sender <sender@example.com>"' \
\r
849 - '[to]=3D"Some List <list@example.com>"' \
\r
850 - [subject]=3Dnotmuch-reply-test \
\r
851 - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \
\r
852 - '[body]=3D"Un-munging Reply-To"' \
\r
853 - '[reply-to]=3D"Evil Munging List <list@example.com>"'
\r
855 -output=3D$($NOTMUCH reply id:${gen_msg_id})
\r
856 -pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.=
\r
858 -Subject: Re: notmuch-reply-test
\r
859 -To: Sender <sender@example.com>, Some List <list@example.com>
\r
860 -Bcc: test_suite@notmuchmail.org
\r
861 -In-Reply-To: <${gen_msg_id}>
\r
862 -References: <${gen_msg_id}>
\r
864 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
\r
865 -> Un-munging Reply-To"
\r
867 -printf "\nTesting handling of uuencoded data:\n"
\r
869 -add_message [subject]=3Duuencodetest '[date]=3D"Sat, 01 Jan 2000 12:00:00 =
\r
871 -'[body]=3D"This message is used to ensure that notmuch correctly handles a
\r
872 -message containing a block of uuencoded data. First, we have a marker
\r
873 -this content beforeuudata . Then we beging the uunencoded data itself:
\r
875 -begin 644 bogus-uuencoded-data
\r
876 -M0123456789012345678901234567890123456789012345678901234567890
\r
877 -MOBVIOUSLY, THIS IS NOT ANY SORT OF USEFUL UUNECODED DATA.=20=20=20=20
\r
878 -MINSTEAD THIS IS JUST A WAY TO ENSURE THAT THIS BLOCK OF DATA=20
\r
879 -MIS CORRECTLY IGNORED WHEN NOTMUCH CREATES ITS INDEX. SO WE=20=20=20
\r
880 -MINCLUDE A DURINGUUDATA MARKER THAT SHOULD NOT RESULT IN ANY=20=20
\r
881 -MSEARCH RESULT.=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
\r
882 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
\r
887 -Finally, we have our afteruudata marker as well."'
\r
889 -printf " Ensure content before uu data is indexed...\t"
\r
890 -output=3D$($NOTMUCH search beforeuudata | notmuch_search_sanitize)
\r
891 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;=
\r
892 uuencodetest (inbox unread)"
\r
893 -printf " Ensure uu data is not indexed...\t\t"
\r
894 -output=3D$($NOTMUCH search DURINGUUDATA | notmuch_search_sanitize)
\r
895 -pass_if_equal "$output" ""
\r
896 -printf " Ensure content after uu data is indexed...\t"
\r
897 -output=3D$($NOTMUCH search afteruudata | notmuch_search_sanitize)
\r
898 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;=
\r
899 uuencodetest (inbox unread)"
\r
901 -printf "\nTesting \"notmuch dump\" and \"notmuch restore\":\n"
\r
903 -printf " Dumping all tags...\t\t\t\t"
\r
904 -$NOTMUCH dump dump.expected
\r
905 -pass_if_equal "$?" "0"
\r
907 -printf " Clearing all tags...\t\t\t\t"
\r
908 -sed -e 's/(\([^(]*\))$/()/' < dump.expected > clear.expected
\r
909 -$NOTMUCH restore clear.expected
\r
910 -$NOTMUCH dump clear.actual
\r
911 -pass_if_equal "$(< clear.actual)" "$(< clear.expected)"
\r
913 -printf " Restoring original tags...\t\t\t"
\r
914 -$NOTMUCH restore dump.expected
\r
915 -$NOTMUCH dump dump.actual
\r
916 -pass_if_equal "$(< dump.actual)" "$(< dump.expected)"
\r
918 -printf " Restore with nothing to do...\t\t\t"
\r
919 -$NOTMUCH restore dump.expected
\r
920 -pass_if_equal "$?" "0"
\r
922 -printf "\nTesting threading when messages received out of order:\n"
\r
923 -printf " Adding initial child message...\t\t"
\r
924 -generate_message [body]=3Dfoo '[in-reply-to]=3D\<parent-id\>' [subject]=3D=
\r
925 brokenthreadtest '[date]=3D"Sat, 01 Jan 2000 12:00:00 -0000"'
\r
926 -output=3D$(NOTMUCH_NEW)
\r
927 -pass_if_equal "$output" "Added 1 new message to the database."
\r
928 -printf " Searching returns the message...\t\t"
\r
929 -output=3D$($NOTMUCH search foo | notmuch_search_sanitize)
\r
930 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite;=
\r
931 brokenthreadtest (inbox unread)"
\r
932 -printf " Adding second child message...\t\t\t"
\r
933 -generate_message [body]=3Dfoo '[in-reply-to]=3D\<parent-id\>' [subject]=3D=
\r
934 brokenthreadtest '[date]=3D"Sat, 01 Jan 2000 12:00:00 -0000"'
\r
935 -output=3D$(NOTMUCH_NEW)
\r
936 -pass_if_equal "$output" "Added 1 new message to the database."
\r
937 -printf " Searching returns both messages in one thread..."
\r
938 -output=3D$($NOTMUCH search foo | notmuch_search_sanitize)
\r
939 -pass_if_equal "$output" "thread:XXX 2000-01-01 [2/2] Notmuch Test Suite;=
\r
940 brokenthreadtest (inbox unread)"
\r
941 -printf " Adding parent message...\t\t\t"
\r
942 -generate_message [body]=3Dfoo [id]=3Dparent-id [subject]=3Dbrokenthreadtes=
\r
943 t '[date]=3D"Sat, 01 Jan 2000 12:00:00 -0000"'
\r
944 -output=3D$(NOTMUCH_NEW)
\r
945 -pass_if_equal "$output" "Added 1 new message to the database."
\r
946 -printf " Searching returns all three messages in one thread..."
\r
947 -output=3D$($NOTMUCH search foo | notmuch_search_sanitize)
\r
948 -pass_if_equal "$output" "thread:XXX 2000-01-01 [3/3] Notmuch Test Suite;=
\r
949 brokenthreadtest (inbox unread)"
\r
951 -printf "\nTesting author reordering;\n"
\r
952 -printf " Adding parent message...\t\t\t"
\r
953 -generate_message [body]=3Dfindme [id]=3Dnew-parent-id [subject]=3Dauthor-r=
\r
954 eorder-threadtest '[from]=3D"User <user@example.com>"' '[date]=3D"Sat, 01 J=
\r
955 an 2000 12:00:00 -0000"'
\r
956 -output=3D$(NOTMUCH_NEW)
\r
957 -pass_if_equal "$output" "Added 1 new message to the database."
\r
958 -printf " Adding initial child message...\t\t"
\r
959 -generate_message [body]=3Dfindme '[in-reply-to]=3D\<new-parent-id\>' [subj=
\r
960 ect]=3Dauthor-reorder-threadtest '[from]=3D"User1 <user1@example.com>"' '[d=
\r
961 ate]=3D"Sat, 01 Jan 2000 12:00:00 -0000"'
\r
962 -output=3D$(NOTMUCH_NEW)
\r
963 -pass_if_equal "$output" "Added 1 new message to the database."
\r
964 -printf " Adding second child message...\t\t\t"
\r
965 -generate_message [body]=3Dfindme '[in-reply-to]=3D\<new-parent-id\>' [subj=
\r
966 ect]=3Dauthor-reorder-threadtest '[from]=3D"User2 <user2@example.com>"' '[d=
\r
967 ate]=3D"Sat, 01 Jan 2000 12:00:00 -0000"'
\r
968 -output=3D$(NOTMUCH_NEW)
\r
969 -pass_if_equal "$output" "Added 1 new message to the database."
\r
970 -printf " Searching when all three messages match...\t"
\r
971 -output=3D$($NOTMUCH search findme | notmuch_search_sanitize)
\r
972 -pass_if_equal "$output" "thread:XXX 2000-01-01 [3/3] User, User1, User2;=
\r
973 author-reorder-threadtest (inbox unread)"
\r
974 -printf " Searching when two messages match...\t\t"
\r
975 -output=3D$($NOTMUCH search User1 or User2 | notmuch_search_sanitize)
\r
976 -pass_if_equal "$output" "thread:XXX 2000-01-01 [2/3] User1, User2| User;=
\r
977 author-reorder-threadtest (inbox unread)"
\r
978 -printf " Searching when only one message matches...\t"
\r
979 -output=3D$($NOTMUCH search User2 | notmuch_search_sanitize)
\r
980 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/3] User2| User, User1;=
\r
981 author-reorder-threadtest (inbox unread)"
\r
982 -printf " Searching when only first message matches...\t"
\r
983 -output=3D$($NOTMUCH search User | notmuch_search_sanitize)
\r
984 -pass_if_equal "$output" "thread:XXX 2000-01-01 [1/3] User| User1, User2;=
\r
985 author-reorder-threadtest (inbox unread)"
\r
987 -printf "\nTesting From line heuristics (with multiple configured addresses=
\r
989 -printf " Magic from guessing (nothing to go on)...\t"
\r
990 -add_message '[from]=3D"Sender <sender@example.com>"' \
\r
991 - [to]=3Dmailinglist@notmuchmail.org \
\r
992 - [subject]=3Dnotmuch-reply-test \
\r
993 - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \
\r
994 - '[body]=3D"from guessing test"'
\r
996 -output=3D$($NOTMUCH reply id:${gen_msg_id})
\r
997 -pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.=
\r
999 -Subject: Re: notmuch-reply-test
\r
1000 -To: Sender <sender@example.com>, mailinglist@notmuchmail.org
\r
1001 -Bcc: test_suite@notmuchmail.org
\r
1002 -In-Reply-To: <${gen_msg_id}>
\r
1003 -References: <${gen_msg_id}>
\r
1005 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
\r
1006 -> from guessing test"
\r
1008 -printf " Magic from guessing (Envelope-to:)...\t\t"
\r
1009 -add_message '[from]=3D"Sender <sender@example.com>"' \
\r
1010 - [to]=3Dmailinglist@notmuchmail.org \
\r
1011 - [subject]=3Dnotmuch-reply-test \
\r
1012 - '[header]=3D"Envelope-To: test_suite_other@notmuchmail.org"' \
\r
1013 - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \
\r
1014 - '[body]=3D"from guessing test"'
\r
1016 -output=3D$($NOTMUCH reply id:${gen_msg_id})
\r
1017 -pass_if_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuc=
\r
1019 -Subject: Re: notmuch-reply-test
\r
1020 -To: Sender <sender@example.com>, mailinglist@notmuchmail.org
\r
1021 -Bcc: test_suite@notmuchmail.org
\r
1022 -In-Reply-To: <${gen_msg_id}>
\r
1023 -References: <${gen_msg_id}>
\r
1025 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
\r
1026 -> from guessing test"
\r
1028 -printf " Magic from guessing (X-Original-To:)...\t"
\r
1029 -add_message '[from]=3D"Sender <sender@example.com>"' \
\r
1030 - [to]=3Dmailinglist@notmuchmail.org \
\r
1031 - [subject]=3Dnotmuch-reply-test \
\r
1032 - '[header]=3D"X-Original-To: test_suite_other@notmuchmail.org"'=
\r
1034 - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \
\r
1035 - '[body]=3D"from guessing test"'
\r
1037 -output=3D$($NOTMUCH reply id:${gen_msg_id})
\r
1038 -pass_if_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuc=
\r
1040 -Subject: Re: notmuch-reply-test
\r
1041 -To: Sender <sender@example.com>, mailinglist@notmuchmail.org
\r
1042 -Bcc: test_suite@notmuchmail.org
\r
1043 -In-Reply-To: <${gen_msg_id}>
\r
1044 -References: <${gen_msg_id}>
\r
1046 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
\r
1047 -> from guessing test"
\r
1049 -printf " Magic from guessing (Received: .. for ..)...\t"
\r
1050 -add_message '[from]=3D"Sender <sender@example.com>"' \
\r
1051 - [to]=3Dmailinglist@notmuchmail.org \
\r
1052 - [subject]=3Dnotmuch-reply-test \
\r
1053 - '[header]=3D"Received: from mail.example.com (mail.example.com=
\r
1055 - by mail.notmuchmail.org (some MTA) with ESMTP id 12345678\
\r
1056 - for <test_suite_other@notmuchmail.org>; Sat, 10 Apr 2010 07:54:51 =
\r
1058 - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \
\r
1059 - '[body]=3D"from guessing test"'
\r
1061 -output=3D$($NOTMUCH reply id:${gen_msg_id})
\r
1062 -pass_if_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuc=
\r
1064 -Subject: Re: notmuch-reply-test
\r
1065 -To: Sender <sender@example.com>, mailinglist@notmuchmail.org
\r
1066 -Bcc: test_suite@notmuchmail.org
\r
1067 -In-Reply-To: <${gen_msg_id}>
\r
1068 -References: <${gen_msg_id}>
\r
1070 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
\r
1071 -> from guessing test"
\r
1073 -printf " Magic from guessing (Received: domain)...\t"
\r
1074 -add_message '[from]=3D"Sender <sender@example.com>"' \
\r
1075 - [to]=3Dmailinglist@notmuchmail.org \
\r
1076 - [subject]=3Dnotmuch-reply-test \
\r
1077 - '[header]=3D"Received: from mail.example.com (mail.example.com=
\r
1079 - by mail.otherdomain.org (some MTA) with ESMTP id 12345678\
\r
1080 - Sat, 10 Apr 2010 07:54:51 -0400 (EDT)"' \
\r
1081 - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \
\r
1082 - '[body]=3D"from guessing test"'
\r
1084 -output=3D$($NOTMUCH reply id:${gen_msg_id})
\r
1085 -pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@otherdomain.=
\r
1087 -Subject: Re: notmuch-reply-test
\r
1088 -To: Sender <sender@example.com>, mailinglist@notmuchmail.org
\r
1089 -Bcc: test_suite@notmuchmail.org
\r
1090 -In-Reply-To: <${gen_msg_id}>
\r
1091 -References: <${gen_msg_id}>
\r
1093 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
\r
1094 -> from guessing test"
\r
1097 -printf "\nTesting From line heuristics (with single configured address):\n"
\r
1098 -sed -i -e 's/^other_email.*//' ${NOTMUCH_CONFIG}
\r
1100 -printf " Magic from guessing (nothing to go on)...\t"
\r
1101 -add_message '[from]=3D"Sender <sender@example.com>"' \
\r
1102 - [to]=3Dmailinglist@notmuchmail.org \
\r
1103 - [subject]=3Dnotmuch-reply-test \
\r
1104 - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \
\r
1105 - '[body]=3D"from guessing test"'
\r
1107 -output=3D$($NOTMUCH reply id:${gen_msg_id})
\r
1108 -pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.=
\r
1110 -Subject: Re: notmuch-reply-test
\r
1111 -To: Sender <sender@example.com>, mailinglist@notmuchmail.org
\r
1112 -Bcc: test_suite@notmuchmail.org
\r
1113 -In-Reply-To: <${gen_msg_id}>
\r
1114 -References: <${gen_msg_id}>
\r
1116 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
\r
1117 -> from guessing test"
\r
1119 -printf " Magic from guessing (Envelope-to:)...\t\t"
\r
1120 -add_message '[from]=3D"Sender <sender@example.com>"' \
\r
1121 - [to]=3Dmailinglist@notmuchmail.org \
\r
1122 - [subject]=3Dnotmuch-reply-test \
\r
1123 - '[header]=3D"Envelope-To: test_suite_other@notmuchmail.org"' \
\r
1124 - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \
\r
1125 - '[body]=3D"from guessing test"'
\r
1127 -output=3D$($NOTMUCH reply id:${gen_msg_id})
\r
1128 -pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.=
\r
1130 -Subject: Re: notmuch-reply-test
\r
1131 -To: Sender <sender@example.com>, mailinglist@notmuchmail.org
\r
1132 -Bcc: test_suite@notmuchmail.org
\r
1133 -In-Reply-To: <${gen_msg_id}>
\r
1134 -References: <${gen_msg_id}>
\r
1136 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
\r
1137 -> from guessing test"
\r
1139 -printf " Magic from guessing (X-Original-To:)...\t"
\r
1140 -add_message '[from]=3D"Sender <sender@example.com>"' \
\r
1141 - [to]=3Dmailinglist@notmuchmail.org \
\r
1142 - [subject]=3Dnotmuch-reply-test \
\r
1143 - '[header]=3D"X-Original-To: test_suite_other@notmuchmail.org"'=
\r
1145 - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \
\r
1146 - '[body]=3D"from guessing test"'
\r
1148 -output=3D$($NOTMUCH reply id:${gen_msg_id})
\r
1149 -pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.=
\r
1151 -Subject: Re: notmuch-reply-test
\r
1152 -To: Sender <sender@example.com>, mailinglist@notmuchmail.org
\r
1153 -Bcc: test_suite@notmuchmail.org
\r
1154 -In-Reply-To: <${gen_msg_id}>
\r
1155 -References: <${gen_msg_id}>
\r
1157 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
\r
1158 -> from guessing test"
\r
1160 -printf " Magic from guessing (Received: .. for ..)...\t"
\r
1161 -add_message '[from]=3D"Sender <sender@example.com>"' \
\r
1162 - [to]=3Dmailinglist@notmuchmail.org \
\r
1163 - [subject]=3Dnotmuch-reply-test \
\r
1164 - '[header]=3D"Received: from mail.example.com (mail.example.com=
\r
1166 - by mail.notmuchmail.org (some MTA) with ESMTP id 12345678\
\r
1167 - for <test_suite_other@notmuchmail.org>; Sat, 10 Apr 2010 07:54:51 =
\r
1169 - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \
\r
1170 - '[body]=3D"from guessing test"'
\r
1172 -output=3D$($NOTMUCH reply id:${gen_msg_id})
\r
1173 -pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.=
\r
1175 -Subject: Re: notmuch-reply-test
\r
1176 -To: Sender <sender@example.com>, mailinglist@notmuchmail.org
\r
1177 -Bcc: test_suite@notmuchmail.org
\r
1178 -In-Reply-To: <${gen_msg_id}>
\r
1179 -References: <${gen_msg_id}>
\r
1181 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
\r
1182 -> from guessing test"
\r
1184 -printf " Magic from guessing (Received: domain)...\t"
\r
1185 -add_message '[from]=3D"Sender <sender@example.com>"' \
\r
1186 - [to]=3Dmailinglist@notmuchmail.org \
\r
1187 - [subject]=3Dnotmuch-reply-test \
\r
1188 - '[header]=3D"Received: from mail.example.com (mail.example.com=
\r
1190 - by mail.otherdomain.org (some MTA) with ESMTP id 12345678\
\r
1191 - Sat, 10 Apr 2010 07:54:51 -0400 (EDT)"' \
\r
1192 - '[date]=3D"Tue, 05 Jan 2010 15:43:56 -0800"' \
\r
1193 - '[body]=3D"from guessing test"'
\r
1194 +run_collection_setup_and_tests ()
\r
1196 + for testfile in $(find ${TEST_COLLECTION_DIR}/$1 \
\r
1197 + -name "*.test" -o -name "*.setup" |
\r
1200 + source $testfile
\r
1204 -output=3D$($NOTMUCH reply id:${gen_msg_id})
\r
1205 -pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.=
\r
1207 -Subject: Re: notmuch-reply-test
\r
1208 -To: Sender <sender@example.com>, mailinglist@notmuchmail.org
\r
1209 -Bcc: test_suite@notmuchmail.org
\r
1210 -In-Reply-To: <${gen_msg_id}>
\r
1211 -References: <${gen_msg_id}>
\r
1212 +run_test_suite ()
\r
1214 + initialize_notmuch_test;
\r
1216 + if [ "$#" =3D "0" -o "$1" =3D "all" ]; then
\r
1217 + for dir in $(echo ${TEST_COLLECTIONS}); do
\r
1218 + run_collection_setup_and_tests "$(basename ${dir})";
\r
1220 + elif [ ! -d "${TEST_COLLECTION_DIR}/$1" ]; then
\r
1221 + echo "${TEST_COLLECTION_DIR}/$1 is not a directory"
\r
1224 + run_collection_setup_and_tests "$1";
\r
1228 -On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
\r
1229 -> from guessing test"
\r
1230 +run_test_suite $1
\r
1233 echo "Notmuch test suite complete."
\r