1 Return-Path: <fgeller@gmail.com>
\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 6D427431FB6
\r
6 for <notmuch@notmuchmail.org>; Mon, 30 May 2011 05:40:13 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.789 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, T_MIME_NO_TEXT=0.01]
\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 LQMFa6WE-na1 for <notmuch@notmuchmail.org>;
\r
18 Mon, 30 May 2011 05:40:11 -0700 (PDT)
\r
19 Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com
\r
20 [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id 84F9D431FD0
\r
23 for <notmuch@notmuchmail.org>; Mon, 30 May 2011 05:40:11 -0700 (PDT)
\r
24 Received: by fxm8 with SMTP id 8so2746626fxm.26
\r
25 for <notmuch@notmuchmail.org>; Mon, 30 May 2011 05:40:09 -0700 (PDT)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
27 h=domainkey-signature:from:to:subject:in-reply-to:references
\r
28 :user-agent:date:message-id:mime-version:content-type;
\r
29 bh=kZrMu10rZ8dD7L16vWyOokLfPez1mE8ukSa3h47zLVU=;
\r
30 b=pwOPciuCJyU17BkZKQ8ZKTU/kjoKHvMV+bmbWaBoS/ld6Fc2V0NJ8MYIqnJEiPUOMR
\r
31 TP2yxe/i2qB1V46PF7TRpYbkB6wa0t+UsM4E8EDp1CkMI81jkBByQrPqXjA3ubjQGMU1
\r
32 0EFgCI69vH4B3xLASL+b732W2kogUo/6wH5G0=
\r
33 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
\r
34 h=from:to:subject:in-reply-to:references:user-agent:date:message-id
\r
35 :mime-version:content-type;
\r
36 b=XSt4MJsXudFWN7MLHTceh3apNwfHy9Pomw6Xso/ATve9MxOy/esKu4zwwqIuhdB7pb
\r
37 ReLfcZWebrQG0X2wYyGXWSg9l6PxUCjBm8HEsYM3C8btQcWt4PItEIf1wbrfV5jIx8Gy
\r
38 68ISJn/xcCtAjV4eAd8HNi+2RfUYBgQ4auJN0=
\r
39 Received: by 10.223.73.139 with SMTP id q11mr5537928faj.56.1306759209760;
\r
40 Mon, 30 May 2011 05:40:09 -0700 (PDT)
\r
41 Received: from localhorst.example.com (brln-4d0c70e5.pool.mediaWays.net
\r
43 by mx.google.com with ESMTPS id r10sm729237fah.2.2011.05.30.05.40.06
\r
44 (version=TLSv1/SSLv3 cipher=OTHER);
\r
45 Mon, 30 May 2011 05:40:08 -0700 (PDT)
\r
46 Received: by localhorst.example.com (Postfix, from userid 501)
\r
47 id 2667942036A9; Mon, 30 May 2011 14:40:04 +0200 (CEST)
\r
48 From: Felix Geller <fgeller@gmail.com>
\r
49 To: Carl Worth <cworth@cworth.org>, notmuch@notmuchmail.org
\r
50 Subject: Re: [PATCH] Change in increment_mtime for BSD compatibility of test
\r
52 In-Reply-To: <87boypcdrw.fsf@yoom.home.cworth.org>
\r
53 References: <m2sjs3q66v.fsf@gmail.com> <87boypcdrw.fsf@yoom.home.cworth.org>
\r
54 User-Agent: Emacs/23.3.1 (x86_64-apple-darwin10.7.0)
\r
55 Date: Mon, 30 May 2011 14:40:04 +0200
\r
56 Message-ID: <m21uzgfjkr.fsf@gmail.com>
\r
58 Content-Type: multipart/signed; boundary="=-=-=";
\r
59 micalg=pgp-sha1; protocol="application/pgp-signature"
\r
60 X-BeenThere: notmuch@notmuchmail.org
\r
61 X-Mailman-Version: 2.1.13
\r
63 List-Id: "Use and development of the notmuch mail system."
\r
64 <notmuch.notmuchmail.org>
\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
66 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
68 List-Post: <mailto:notmuch@notmuchmail.org>
\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
71 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
72 X-List-Received-Date: Mon, 30 May 2011 12:40:13 -0000
\r
75 Content-Transfer-Encoding: quoted-printable
\r
81 Support for platform-specific test configuration
\r
82 - Platform-specific functionality is stored in test-config-PLATFORM.sh=
\r
84 - configure script creates a test/test-config.sh depending on the plat=
\r
86 - test-lib.sh loads test-config.sh file
\r
87 - Some platform-specific functionality included for gnu/bsd:
\r
88 - Work-around for touch -d on BSD
\r
89 - Variable to store sed command for extended expressions
\r
91 diff --git a/configure b/configure
\r
92 index bbf30cd..053a4a1 100755
\r
95 @@ -16,6 +16,13 @@ if [ "$srcdir" !=3D "." ]; then
\r
96 # whole thing into the build directory.
\r
97 cp -a "$srcdir"/test/* test
\r
99 + # Platform specific test configuration
\r
100 + if [ $platform =3D MACOSX ] ; then
\r
101 + cp test/test-config-bsd.sh test/test-config.sh
\r
103 + cp test/test-config-gnu.sh test/test-config.sh
\r
106 # Emacs only likes to generate compiled files next to the .el files
\r
107 # by default so copy these as well (which is not ideal0.
\r
108 cp -a "$srcdir"/emacs/*.el emacs
\r
109 diff --git a/test/basic b/test/basic
\r
110 index 808c968..5fbedfe 100755
\r
113 @@ -54,13 +54,14 @@ test_begin_subtest 'Ensure that all available tests wil=
\r
114 l be run by notmuch-test'
\r
115 eval $(sed -n -e '/^TESTS=3D"$/,/^"$/p' notmuch-test ../notmuch-test)
\r
116 tests_in_suite=3D$(for i in $TESTS; do echo $i; done | sort)
\r
117 available=3D$(ls -1 ../ | \
\r
118 =2D sed -r -e "/^(aggregate-results.sh|Makefile|Makefile.local|notmuch-t=
\r
120 =2D -e "/^(README|test-lib.sh|test-lib.el|test-results|tmp.*|valgrind|co=
\r
122 =2D -e "/^(emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose)/d=
\r
124 =2D -e "/^(test.expected-output|.*~)/d" \
\r
125 =2D -e "/^(gnupg-secret-key.asc)/d" \
\r
126 =2D -e "/^(gnupg-secret-key.NOTE)/d" \
\r
128 + $SED_EXTENDED -e "/^(aggregate-results.sh|Makefile|Makefile.local|notm=
\r
130 + -e "/^(README|test-lib.sh|test-lib.el|test-results|tmp.*|valgrind|=
\r
132 + -e "/^(emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose)=
\r
134 + -e "/^(test.expected-output|.*~)/d" \
\r
135 + -e "/^(gnupg-secret-key.asc)/d" \
\r
136 + -e "/^(gnupg-secret-key.NOTE)/d" \
\r
137 + -e "/^(test-config*)/d" \
\r
139 test_expect_equal "$tests_in_suite" "$available"
\r
141 EXPECTED=3D../test.expected-output
\r
142 diff --git a/test/test-config-bsd.sh b/test/test-config-bsd.sh
\r
143 new file mode 100644
\r
144 index 0000000..e35d2fa
\r
146 +++ b/test/test-config-bsd.sh
\r
148 +# This file contains helper functions and other values that are
\r
149 +# require platform-specific functionality (e.g., differing between GNU
\r
150 +# and BSD). The configure script is used to identify the appropriate
\r
151 +# file for a given platform, and copies the file test-config-FOO.sh to
\r
152 +# test-config.sh, where FOO is the respective platform (bsd or gnu).
\r
154 +# This file is BSD-specific.
\r
156 +# Syntax for extended expressions
\r
157 +SED_EXTENDED=3D"sed -E"
\r
159 +# There is no touch -d on BSD, therefore we have to use a more tedious
\r
160 +# version that uses date/stat to increment a date by a single second.
\r
161 +increment_mtime_amount=3D0
\r
162 +increment_mtime ()
\r
166 + last_mod_date=3D`date -j -f %Y%m%d%H%M%S \`stat -f %Sm -t %Y%m%d%H%M%S=
\r
168 + increment_mtime_amount=3D$((increment_mtime_amount + 1))
\r
169 + new_date=3D`date -j -r ${last_mod_date} -v+${increment_mtime_amount}S =
\r
171 + touch -t ${new_date} ${dir}
\r
173 diff --git a/test/test-config-gnu.sh b/test/test-config-gnu.sh
\r
174 new file mode 100644
\r
175 index 0000000..596505a
\r
177 +++ b/test/test-config-gnu.sh
\r
179 +# This file contains helper functions and other values that are
\r
180 +# require platform-specific functionality (e.g., differing between GNU
\r
181 +# and BSD). The configure script is used to identify the appropriate
\r
182 +# file for a given platform, and copies the file test-config-FOO.sh to
\r
183 +# test-config.sh, where FOO is the respective platform (bsd or gnu).
\r
185 +# This file is GNU-specific.
\r
187 +# Syntax for extended expressions
\r
188 +SED_EXTENDED=3D"sed -r"
\r
190 +# Use touch to increment the modification date by a single second.
\r
191 +increment_mtime_amount=3D0
\r
192 +increment_mtime ()
\r
196 + increment_mtime_amount=3D$((increment_mtime_amount + 1))
\r
197 + touch -d "+${increment_mtime_amount} seconds" "$dir"
\r
199 diff --git a/test/test-lib.sh b/test/test-lib.sh
\r
200 index 922b1ef..1aa3a1c 100755
\r
201 =2D-- a/test/test-lib.sh
\r
202 +++ b/test/test-lib.sh
\r
203 @@ -23,6 +23,9 @@ if [ ${BASH_VERSINFO[0]} -lt 4 ]; then
\r
207 +# Load platform-specific values
\r
208 +. ./test-config.sh
\r
210 # if --tee was passed, write the output not only to the terminal, but
\r
211 # additionally to the file test-results/$BASENAME.out, too.
\r
212 case "$GIT_TEST_TEE_STARTED, $* " in
\r
213 @@ -214,14 +217,6 @@ remove_cr () {
\r
216 # Notmuch helper functions
\r
217 =2Dincrement_mtime_amount=3D0
\r
218 =2Dincrement_mtime ()
\r
222 =2D increment_mtime_amount=3D$((increment_mtime_amount + 1))
\r
223 =2D touch -d "+${increment_mtime_amount} seconds" "$dir"
\r
226 # Generate a new message in the mail directory, with a unique message
\r
227 # ID and subject. The message is not added to the index.
\r
228 @@ -514,7 +509,7 @@ NOTMUCH_NEW ()
\r
230 notmuch_search_sanitize ()
\r
232 =2D sed -r -e 's/("?thread"?: ?)("?)................("?)/\1\2XXX\3/'
\r
233 + $SED_EXTENDED 's/("?thread"?: ?)("?)................("?)/\1\2XXX\3/'
\r
236 NOTMUCH_SHOW_FILENAME_SQUELCH=3D's,filename:.*/mail,filename:/XXX/mail,'
\r
239 Content-Type: application/pgp-signature
\r
241 -----BEGIN PGP SIGNATURE-----
\r
242 Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
\r
244 iEYEARECAAYFAk3jkCQACgkQMxgKfMb9y5amNACfU35yBvIF2S0VB8Tx9u0MWJqN
\r
245 ij4AoLmczzcV6N67MnTcqKIp4dO8SAQt
\r
247 -----END PGP SIGNATURE-----
\r