1 Return-Path: <tomi.ollila@iki.fi>
\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 181E4431FBF
\r
6 for <notmuch@notmuchmail.org>; Tue, 11 Mar 2014 12:43:55 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 Hh8GAbmYRtuc for <notmuch@notmuchmail.org>;
\r
16 Tue, 11 Mar 2014 12:43:47 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 6DB84431FBD
\r
19 for <notmuch@notmuchmail.org>; Tue, 11 Mar 2014 12:43:47 -0700 (PDT)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id EC68610008C;
\r
22 Tue, 11 Mar 2014 21:43:42 +0200 (EET)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org
\r
25 Subject: Re: [PATCH] test: conditionally test compact depending on configured
\r
27 In-Reply-To: <1394565847-26795-1-git-send-email-jani@nikula.org>
\r
28 References: <1394565847-26795-1-git-send-email-jani@nikula.org>
\r
29 User-Agent: Notmuch/0.17+112~g4e0c1d5 (http://notmuchmail.org) Emacs/24.3.1
\r
30 (x86_64-unknown-linux-gnu)
\r
31 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
32 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
33 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
34 Date: Tue, 11 Mar 2014 21:43:42 +0200
\r
35 Message-ID: <m2mwgwwmfl.fsf@guru.guru-group.fi>
\r
37 Content-Type: text/plain
\r
38 X-BeenThere: notmuch@notmuchmail.org
\r
39 X-Mailman-Version: 2.1.13
\r
41 List-Id: "Use and development of the notmuch mail system."
\r
42 <notmuch.notmuchmail.org>
\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
46 List-Post: <mailto:notmuch@notmuchmail.org>
\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
50 X-List-Received-Date: Tue, 11 Mar 2014 19:43:55 -0000
\r
52 On Tue, Mar 11 2014, Jani Nikula <jani@nikula.org> wrote:
\r
54 > I still have one machine with old enough Xapian to not have compaction
\r
55 > support. Make the tests check for unsupported compact operation when
\r
56 > compact is not available.
\r
58 > test/Makefile.local | 9 +++++++++
\r
59 > test/T020-compact.sh | 11 +++++++++++
\r
60 > 2 files changed, 20 insertions(+)
\r
62 > diff --git a/test/Makefile.local b/test/Makefile.local
\r
63 > index 36b1c1b71de0..8befa40dfaa4 100644
\r
64 > --- a/test/Makefile.local
\r
65 > +++ b/test/Makefile.local
\r
66 > @@ -35,9 +35,18 @@ $(dir)/symbol-test: $(dir)/symbol-test.o lib/$(LINKER_NAME)
\r
67 > $(dir)/parse-time: $(dir)/parse-time.o parse-time-string/parse-time-string.o
\r
68 > $(call quiet,CC) $^ -o $@
\r
70 > +$(dir)/have-compact: Makefile.config
\r
71 > +ifeq ($(HAVE_XAPIAN_COMPACT),1)
\r
72 > + echo -n "#!/bin/sh\nexit 0\n" > $@
\r
74 > + echo -n "#!/bin/sh\nexit 1\n" > $@
\r
79 printf '$#/bin/sh\nexit1\n' ...
\r
81 ... as '\n' expansion is not portable (bash by default do not expand,
\r
86 $(dir)/have-compact: Makefile.config
\r
87 ifeq ($(HAVE_XAPIAN_COMPACT),1)
\r
94 this is soo much faster ;)
\r
95 1) no shell needed in make
\r
96 2) no shell needs to be executed when running have-compact
\r
103 > .PHONY: test check
\r
105 > TEST_BINARIES=$(dir)/arg-test \
\r
106 > + $(dir)/have-compact \
\r
107 > $(dir)/hex-xcode \
\r
108 > $(dir)/random-corpus \
\r
109 > $(dir)/parse-time \
\r
110 > diff --git a/test/T020-compact.sh b/test/T020-compact.sh
\r
111 > index ac174cec7111..77bb9632cb11 100755
\r
112 > --- a/test/T020-compact.sh
\r
113 > +++ b/test/T020-compact.sh
\r
114 > @@ -10,6 +10,17 @@ notmuch tag +tag1 \*
\r
115 > notmuch tag +tag2 subject:Two
\r
116 > notmuch tag -tag1 +tag3 subject:Three
\r
118 > +if ! ${TEST_DIRECTORY}/have-compact; then
\r
119 > + test_begin_subtest "Compact unsupported: error message"
\r
120 > + output=$(notmuch compact --quiet 2>&1)
\r
121 > + test_expect_equal "$output" "notmuch was compiled against a xapian version lacking compaction support.
\r
122 > +Compaction failed: Unsupported operation"
\r
124 > + test_expect_code 1 "Compact unsupported: status code" "notmuch compact"
\r
129 > test_expect_success "Running compact" "notmuch compact --backup=${TEST_DIRECTORY}/xapian.old"
\r
131 > test_begin_subtest "Compact preserves database"
\r