1 Return-Path: <sojkam1@fel.cvut.cz>
\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 0CEDF431FBF
\r
6 for <notmuch@notmuchmail.org>; Wed, 3 Feb 2010 05:43:27 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.332 tagged_above=-999 required=5
\r
12 tests=[AWL=-0.592, BAYES_20=-0.74] autolearn=ham
\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 DY0y5cD4AMaT for <notmuch@notmuchmail.org>;
\r
16 Wed, 3 Feb 2010 05:43:24 -0800 (PST)
\r
17 Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 79210431FBD
\r
19 for <notmuch@notmuchmail.org>; Wed, 3 Feb 2010 05:43:24 -0800 (PST)
\r
20 Received: from localhost (unknown [192.168.200.4])
\r
21 by max.feld.cvut.cz (Postfix) with ESMTP id 3120F19F3400
\r
22 for <notmuch@notmuchmail.org>; Wed, 3 Feb 2010 14:43:04 +0100 (CET)
\r
23 X-Virus-Scanned: IMAP AMAVIS
\r
24 Received: from max.feld.cvut.cz ([192.168.200.1])
\r
25 by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,
\r
26 port 10044) with ESMTP id CbfWugWyCjPs for <notmuch@notmuchmail.org>;
\r
27 Wed, 3 Feb 2010 14:42:59 +0100 (CET)
\r
28 Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])
\r
29 by max.feld.cvut.cz (Postfix) with ESMTP id A772B19F35D6
\r
30 for <notmuch@notmuchmail.org>; Wed, 3 Feb 2010 14:42:55 +0100 (CET)
\r
31 Received: from localhost.localdomain (k335-30.felk.cvut.cz [147.32.86.30])
\r
32 (Authenticated sender: sojkam1)
\r
33 by imap.feld.cvut.cz (Postfix) with ESMTPSA id 84213FA005
\r
34 for <notmuch@notmuchmail.org>; Wed, 3 Feb 2010 14:42:55 +0100 (CET)
\r
35 From: Michal Sojka <sojkam1@fel.cvut.cz>
\r
36 To: notmuch@notmuchmail.org
\r
37 Date: Wed, 3 Feb 2010 14:42:47 +0100
\r
38 Message-Id: <1265204568-24018-3-git-send-email-sojkam1@fel.cvut.cz>
\r
39 X-Mailer: git-send-email 1.6.6
\r
40 In-Reply-To: <1265204568-24018-1-git-send-email-sojkam1@fel.cvut.cz>
\r
41 References: <1265204568-24018-1-git-send-email-sojkam1@fel.cvut.cz>
\r
42 Subject: [notmuch] [PATCH 3/4] Rename notmuch-test according to the new
\r
44 X-BeenThere: notmuch@notmuchmail.org
\r
45 X-Mailman-Version: 2.1.13
\r
47 List-Id: "Use and development of the notmuch mail system."
\r
48 <notmuch.notmuchmail.org>
\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
52 List-Post: <mailto:notmuch@notmuchmail.org>
\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
55 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
56 X-List-Received-Date: Wed, 03 Feb 2010 13:43:27 -0000
\r
58 Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
\r
60 test/notmuch-test | 220 ---------------------------------------------
\r
61 test/t0001-notmuch-new.sh | 220 +++++++++++++++++++++++++++++++++++++++++++++
\r
62 2 files changed, 220 insertions(+), 220 deletions(-)
\r
63 delete mode 100755 test/notmuch-test
\r
64 create mode 100755 test/t0001-notmuch-new.sh
\r
66 diff --git a/test/notmuch-test b/test/notmuch-test
\r
67 deleted file mode 100755
\r
68 index d7b85c0..0000000
\r
69 --- a/test/notmuch-test
\r
75 -find_notmuch_binary ()
\r
79 - while [ -n "$dir" ]; do
\r
81 - if [ -x $bin ]; then
\r
85 - dir=$(dirname $dir)
\r
86 - if [ "$dir" = "/" ]; then
\r
94 -# Generate a new message in the mail directory, with
\r
95 -# a unique message ID and subject.
\r
97 -# The filename of the message generated is available as
\r
98 -# $gen_msg_filename
\r
100 -gen_msg_filename=""
\r
101 -generate_message ()
\r
103 - gen_msg_cnt=$((gen_msg_cnt + 1))
\r
104 - gen_msg_name=msg-$(printf "%03d" $gen_msg_cnt)
\r
106 - if [ "$#" = "0" ]; then
\r
107 - gen_msg_filename="${MAIL_DIR}/$gen_msg_name"
\r
109 - gen_msg_filename="${MAIL_DIR}/$1/$gen_msg_name"
\r
110 - mkdir -p $(dirname $gen_msg_filename)
\r
113 -cat <<EOF >$gen_msg_filename
\r
114 -From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
115 -To: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
116 -Message-Id: <msg-${gen_msg_cnt}@notmuch-test-suite>
\r
117 -Subject: Test message ${gen_msg_filename}
\r
118 -Date: Tue, 05 Jan 2010 15:43:57 -0800
\r
120 -This is just a test message at ${gen_msg_filename}
\r
129 -TEST_DIR=$(pwd)/test.$$
\r
130 -MAIL_DIR=${TEST_DIR}/mail
\r
131 -export NOTMUCH_CONFIG=${TEST_DIR}/notmuch-config
\r
132 -NOTMUCH=$(find_notmuch_binary $(pwd))
\r
134 -rm -rf ${TEST_DIR}
\r
140 -cat <<EOF > ${NOTMUCH_CONFIG}
\r
145 -name=Notmuch Test Suite
\r
146 -primary_email=test_suite@notmuchmail.org
\r
149 -echo "### Testing \"notmuch new\" with no messages"
\r
152 -echo "### Testing \"notmuch new\" with 1 new message"
\r
157 -echo "### Testing \"notmuch new\" with 2 new messages"
\r
163 -echo "### Testing \"notmuch new\" with no new messages (and a non-empty database)"
\r
167 -echo "### Testing \"notmuch new\" with two new directories (one mail)"
\r
168 -rm -rf ${MAIL_DIR}/* ${MAIL_DIR}/.notmuch
\r
169 -mkdir ${MAIL_DIR}/def
\r
170 -mkdir ${MAIL_DIR}/ghi
\r
171 -generate_message def
\r
175 -echo "### Testing \"notmuch new\" with two new directories (one mail)---opposite inode order"
\r
177 -rm -rf ${MAIL_DIR}/.notmuch
\r
178 -mv ${MAIL_DIR}/ghi ${MAIL_DIR}/abc
\r
179 -rm ${MAIL_DIR}/def/*
\r
180 -generate_message abc
\r
184 -echo "### Testing \"notmuch new\" with 1 old message moved into the mail store"
\r
185 -rm -rf ${MAIL_DIR}/* ${MAIL_DIR}/.notmuch
\r
187 -tmp_msg_filename=tmp/$gen_msg_filename
\r
188 -mkdir -p $(dirname $tmp_msg_filename)
\r
189 -mv $gen_msg_filename $tmp_msg_filename
\r
191 -$NOTMUCH new > /dev/null
\r
193 -mv $tmp_msg_filename $gen_msg_filename
\r
196 -echo "### Testing \"notmuch new\" with 1 renamed message"
\r
200 -$NOTMUCH new > /dev/null
\r
202 -mv $gen_msg_filename ${gen_msg_filename}-renamed
\r
205 -echo "### Testing \"notmuch new\" with 1 deleted message"
\r
208 -rm ${gen_msg_filename}-renamed
\r
211 -echo "### Testing \"notmuch new\" with a new directory with 3 messages"
\r
214 -generate_message dir
\r
215 -generate_message dir
\r
216 -generate_message dir
\r
220 -echo "### Testing \"notmuch new\" with a renamed directory of 3 messages"
\r
223 -mv ${MAIL_DIR}/dir ${MAIL_DIR}/dir-renamed
\r
227 -echo "### Testing \"notmuch new\" with a deleted directory of 3 messages"
\r
230 -rm -rf ${MAIL_DIR}/dir-renamed
\r
234 -echo "### Testing \"notmuch new\" with a new directory with 3 messages (tail of list)"
\r
237 -generate_message zzz
\r
238 -generate_message zzz
\r
239 -generate_message zzz
\r
243 -echo "### Testing \"notmuch new\" with a deleted directory of 3 messages (tail of list)"
\r
246 -rm -rf ${MAIL_DIR}/zzz
\r
250 -echo "### Testing \"notmuch new\" with a symlink to an external directory of 1 message"
\r
252 -rm -rf ${MAIL_DIR}/.notmuch
\r
253 -mv ${MAIL_DIR} ${TEST_DIR}/actual_maildir
\r
256 -ln -s ${TEST_DIR}/actual_maildir ${MAIL_DIR}/symlink
\r
260 -echo "### Testing \"notmuch new\" with a symlink to an external file"
\r
263 -external_msg_filename=${TEST_DIR}/external/$(basename $gen_msg_filename)
\r
264 -mkdir -p $(dirname $external_msg_filename)
\r
265 -mv $gen_msg_filename $external_msg_filename
\r
266 -ln -s $external_msg_filename $gen_msg_filename
\r
270 -echo "### Testing \"notmuch new\" with a two-level directory with 3 files"
\r
273 -generate_message two/levels
\r
274 -generate_message two/levels
\r
275 -generate_message two/levels
\r
279 -echo "### Testing \"notmuch new\" with deletion of two-level directory (3 files)"
\r
282 -rm -rf ${MAIL_DIR}/two
\r
287 -Notmuch test suite complete.
\r
289 -Intermediate state can be examined in:
\r
292 diff --git a/test/t0001-notmuch-new.sh b/test/t0001-notmuch-new.sh
\r
293 new file mode 100755
\r
294 index 0000000..d7b85c0
\r
296 +++ b/test/t0001-notmuch-new.sh
\r
301 +find_notmuch_binary ()
\r
305 + while [ -n "$dir" ]; do
\r
307 + if [ -x $bin ]; then
\r
311 + dir=$(dirname $dir)
\r
312 + if [ "$dir" = "/" ]; then
\r
320 +# Generate a new message in the mail directory, with
\r
321 +# a unique message ID and subject.
\r
323 +# The filename of the message generated is available as
\r
324 +# $gen_msg_filename
\r
326 +gen_msg_filename=""
\r
327 +generate_message ()
\r
329 + gen_msg_cnt=$((gen_msg_cnt + 1))
\r
330 + gen_msg_name=msg-$(printf "%03d" $gen_msg_cnt)
\r
332 + if [ "$#" = "0" ]; then
\r
333 + gen_msg_filename="${MAIL_DIR}/$gen_msg_name"
\r
335 + gen_msg_filename="${MAIL_DIR}/$1/$gen_msg_name"
\r
336 + mkdir -p $(dirname $gen_msg_filename)
\r
339 +cat <<EOF >$gen_msg_filename
\r
340 +From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
341 +To: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
342 +Message-Id: <msg-${gen_msg_cnt}@notmuch-test-suite>
\r
343 +Subject: Test message ${gen_msg_filename}
\r
344 +Date: Tue, 05 Jan 2010 15:43:57 -0800
\r
346 +This is just a test message at ${gen_msg_filename}
\r
355 +TEST_DIR=$(pwd)/test.$$
\r
356 +MAIL_DIR=${TEST_DIR}/mail
\r
357 +export NOTMUCH_CONFIG=${TEST_DIR}/notmuch-config
\r
358 +NOTMUCH=$(find_notmuch_binary $(pwd))
\r
360 +rm -rf ${TEST_DIR}
\r
366 +cat <<EOF > ${NOTMUCH_CONFIG}
\r
371 +name=Notmuch Test Suite
\r
372 +primary_email=test_suite@notmuchmail.org
\r
375 +echo "### Testing \"notmuch new\" with no messages"
\r
378 +echo "### Testing \"notmuch new\" with 1 new message"
\r
383 +echo "### Testing \"notmuch new\" with 2 new messages"
\r
389 +echo "### Testing \"notmuch new\" with no new messages (and a non-empty database)"
\r
393 +echo "### Testing \"notmuch new\" with two new directories (one mail)"
\r
394 +rm -rf ${MAIL_DIR}/* ${MAIL_DIR}/.notmuch
\r
395 +mkdir ${MAIL_DIR}/def
\r
396 +mkdir ${MAIL_DIR}/ghi
\r
397 +generate_message def
\r
401 +echo "### Testing \"notmuch new\" with two new directories (one mail)---opposite inode order"
\r
403 +rm -rf ${MAIL_DIR}/.notmuch
\r
404 +mv ${MAIL_DIR}/ghi ${MAIL_DIR}/abc
\r
405 +rm ${MAIL_DIR}/def/*
\r
406 +generate_message abc
\r
410 +echo "### Testing \"notmuch new\" with 1 old message moved into the mail store"
\r
411 +rm -rf ${MAIL_DIR}/* ${MAIL_DIR}/.notmuch
\r
413 +tmp_msg_filename=tmp/$gen_msg_filename
\r
414 +mkdir -p $(dirname $tmp_msg_filename)
\r
415 +mv $gen_msg_filename $tmp_msg_filename
\r
417 +$NOTMUCH new > /dev/null
\r
419 +mv $tmp_msg_filename $gen_msg_filename
\r
422 +echo "### Testing \"notmuch new\" with 1 renamed message"
\r
426 +$NOTMUCH new > /dev/null
\r
428 +mv $gen_msg_filename ${gen_msg_filename}-renamed
\r
431 +echo "### Testing \"notmuch new\" with 1 deleted message"
\r
434 +rm ${gen_msg_filename}-renamed
\r
437 +echo "### Testing \"notmuch new\" with a new directory with 3 messages"
\r
440 +generate_message dir
\r
441 +generate_message dir
\r
442 +generate_message dir
\r
446 +echo "### Testing \"notmuch new\" with a renamed directory of 3 messages"
\r
449 +mv ${MAIL_DIR}/dir ${MAIL_DIR}/dir-renamed
\r
453 +echo "### Testing \"notmuch new\" with a deleted directory of 3 messages"
\r
456 +rm -rf ${MAIL_DIR}/dir-renamed
\r
460 +echo "### Testing \"notmuch new\" with a new directory with 3 messages (tail of list)"
\r
463 +generate_message zzz
\r
464 +generate_message zzz
\r
465 +generate_message zzz
\r
469 +echo "### Testing \"notmuch new\" with a deleted directory of 3 messages (tail of list)"
\r
472 +rm -rf ${MAIL_DIR}/zzz
\r
476 +echo "### Testing \"notmuch new\" with a symlink to an external directory of 1 message"
\r
478 +rm -rf ${MAIL_DIR}/.notmuch
\r
479 +mv ${MAIL_DIR} ${TEST_DIR}/actual_maildir
\r
482 +ln -s ${TEST_DIR}/actual_maildir ${MAIL_DIR}/symlink
\r
486 +echo "### Testing \"notmuch new\" with a symlink to an external file"
\r
489 +external_msg_filename=${TEST_DIR}/external/$(basename $gen_msg_filename)
\r
490 +mkdir -p $(dirname $external_msg_filename)
\r
491 +mv $gen_msg_filename $external_msg_filename
\r
492 +ln -s $external_msg_filename $gen_msg_filename
\r
496 +echo "### Testing \"notmuch new\" with a two-level directory with 3 files"
\r
499 +generate_message two/levels
\r
500 +generate_message two/levels
\r
501 +generate_message two/levels
\r
505 +echo "### Testing \"notmuch new\" with deletion of two-level directory (3 files)"
\r
508 +rm -rf ${MAIL_DIR}/two
\r
513 +Notmuch test suite complete.
\r
515 +Intermediate state can be examined in:
\r