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 C85D0409DE5
\r
6 for <notmuch@notmuchmail.org>; Mon, 10 May 2010 09:49:01 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5
\r
12 tests=[BAYES_00=-1.9] 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 4J8lycp2o0yD for <notmuch@notmuchmail.org>;
\r
16 Mon, 10 May 2010 09:48:49 -0700 (PDT)
\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 08841418C25
\r
19 for <notmuch@notmuchmail.org>; Mon, 10 May 2010 09:48:23 -0700 (PDT)
\r
20 Received: from localhost (unknown [192.168.200.4])
\r
21 by max.feld.cvut.cz (Postfix) with ESMTP id 6144319F3407;
\r
22 Mon, 10 May 2010 18:48:22 +0200 (CEST)
\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
27 with ESMTP id JoiujGtlBRS6; Mon, 10 May 2010 18:48:14 +0200 (CEST)
\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 7075219F343E;
\r
30 Mon, 10 May 2010 18:48:14 +0200 (CEST)
\r
31 Received: from steelpick.2x.cz (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 68AC2FA003;
\r
34 Mon, 10 May 2010 18:48:14 +0200 (CEST)
\r
35 Received: from wsh by steelpick.2x.cz with local (Exim 4.71)
\r
36 (envelope-from <sojkam1@fel.cvut.cz>)
\r
37 id 1OBW9O-0005Bb-7g; Mon, 10 May 2010 18:48:14 +0200
\r
38 From: Michal Sojka <sojkam1@fel.cvut.cz>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH v2 3/5] test: Update helper functions
\r
41 Date: Mon, 10 May 2010 18:48:02 +0200
\r
42 Message-Id: <1273510084-19896-4-git-send-email-sojkam1@fel.cvut.cz>
\r
43 X-Mailer: git-send-email 1.7.1
\r
44 In-Reply-To: <1273510084-19896-1-git-send-email-sojkam1@fel.cvut.cz>
\r
45 References: <1273510084-19896-1-git-send-email-sojkam1@fel.cvut.cz>
\r
46 X-BeenThere: notmuch@notmuchmail.org
\r
47 X-Mailman-Version: 2.1.13
\r
49 List-Id: "Use and development of the notmuch mail system."
\r
50 <notmuch.notmuchmail.org>
\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
54 List-Post: <mailto:notmuch@notmuchmail.org>
\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
58 X-List-Received-Date: Mon, 10 May 2010 16:49:02 -0000
\r
60 Modify the helper functions to work with git-based test suite i.e.
\r
61 1) Quote arguments where it is necessary.
\r
62 2) Do not use $NOTMUCH. It doesn't exist and $PATH is set to the build
\r
64 3) Modify pass_if_equal to fit into the git-based test suite.
\r
66 Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
\r
68 test/test-lib.sh | 33 +++++++++++++--------------------
\r
69 1 files changed, 13 insertions(+), 20 deletions(-)
\r
71 diff --git a/test/test-lib.sh b/test/test-lib.sh
\r
72 index e780dd3..06559cd 100755
\r
73 --- a/test/test-lib.sh
\r
74 +++ b/test/test-lib.sh
\r
75 @@ -221,10 +221,10 @@ remove_cr () {
\r
76 increment_mtime_amount=0
\r
82 increment_mtime_amount=$((increment_mtime_amount + 1))
\r
83 - touch -d "+${increment_mtime_amount} seconds" $dir
\r
84 + touch -d "+${increment_mtime_amount} seconds" "$dir"
\r
87 # Generate a new message in the mail directory, with a unique message
\r
88 @@ -289,7 +289,7 @@ generate_message ()
\r
89 gen_msg_filename="${MAIL_DIR}/$gen_msg_name"
\r
91 gen_msg_filename="${MAIL_DIR}/${template[dir]}/$gen_msg_name"
\r
92 - mkdir -p $(dirname $gen_msg_filename)
\r
93 + mkdir -p "$(dirname "$gen_msg_filename")"
\r
96 if [ -z "${template[body]}" ]; then
\r
97 @@ -334,7 +334,7 @@ ${additional_headers}"
\r
101 -cat <<EOF >$gen_msg_filename
\r
102 +cat <<EOF >"$gen_msg_filename"
\r
103 From: ${template[from]}
\r
104 To: ${template[to]}
\r
105 Message-Id: <${gen_msg_id}>
\r
106 @@ -345,7 +345,7 @@ ${template[body]}
\r
109 # Ensure that the mtime of the containing directory is updated
\r
110 - increment_mtime $(dirname ${gen_msg_filename})
\r
111 + increment_mtime "$(dirname "${gen_msg_filename}")"
\r
114 # Generate a new message and add it to the index.
\r
115 @@ -354,41 +354,34 @@ EOF
\r
116 # are also supported here, so see that function for details.
\r
119 - generate_message "$@"
\r
121 - $NOTMUCH new > /dev/null
\r
122 + generate_message "$@" &&
\r
123 + notmuch new > /dev/null
\r
134 - tests=$((tests + 1))
\r
136 if [ "$output" = "$expected" ]; then
\r
141 - testname=test-$(printf "%03d" $tests)
\r
142 + testname=$this_test.$test_count
\r
143 echo "$expected" > $testname.expected
\r
144 echo "$output" > $testname.output
\r
145 - diff -u $testname.expected $testname.output || true
\r
146 - test_failures=$((test_failures + 1))
\r
147 + diff -u $testname.expected $testname.output
\r
152 TEST_DIR=$(pwd)/test.$$
\r
153 MAIL_DIR=${TEST_DIR}/mail
\r
154 export NOTMUCH_CONFIG=${TEST_DIR}/notmuch-config
\r
155 -NOTMUCH=$(find_notmuch_binary $(pwd))
\r
160 - $NOTMUCH new | grep -v -E -e '^Processed [0-9]*( total)? file|Found [0-9]* total file'
\r
161 + notmuch new | grep -v -E -e '^Processed [0-9]*( total)? file|Found [0-9]* total file'
\r
164 notmuch_search_sanitize ()
\r