database error
[notmuch-archives.git] / 76 / 3cb96d423bfd436ed7ba0469219358801456e4
1 Return-Path: <jani@nikula.org>\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 B5E95431FBF\r
6         for <notmuch@notmuchmail.org>; Tue, 11 Mar 2014 12:24:18 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 EnAAT3vW-iZf for <notmuch@notmuchmail.org>;\r
16         Tue, 11 Mar 2014 12:24:12 -0700 (PDT)\r
17 Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com\r
18  [74.125.83.49])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
19  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
20  9627C431FBD    for <notmuch@notmuchmail.org>; Tue, 11 Mar 2014 12:24:12 -0700\r
21  (PDT)\r
22 Received: by mail-ee0-f49.google.com with SMTP id c41so3885344eek.22\r
23         for <notmuch@notmuchmail.org>; Tue, 11 Mar 2014 12:24:11 -0700 (PDT)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=1e100.net; s=20130820;\r
26         h=x-gm-message-state:from:to:cc:subject:date:message-id;\r
27         bh=MJZyN6EtlwKqbdzgIKTq3zrqHqIzN6UQvabf0niW3yY=;\r
28         b=LGhk6htCfihKmr/rSqpKdLqOqpy5I+3SGf/JXyrjjwGZg39KIQKI5bsVXTIAlNXCB8\r
29         yVGFoqlIXLyFpY+FnOjR1U1DXuFqQB5fBKxIvVAUgQ6Q/9pIH27LyOxsOcmXVHebgPUe\r
30         Kp2ASsXZ9QWOyfd9NElpE/d85itIN5nP/9gX/e3CXULO2fqBdkUCrTQ0MwfEVs+eGI4A\r
31         HGfiYigsmDdpDW/vZLV/nD03Bef1+vFUWNZitMKQynbnZyAWyWdkw5NrWMZ58sA0mgxT\r
32         GObBS8q8ZKrlSWbspRwDnFomzlcmQPEkz3QT2BEzNjsnq4ZnjpMCyNI63QvxICzYWtR5\r
33         vB6w==\r
34 X-Gm-Message-State:\r
35  ALoCoQnGoSyvkQYyC7pR092e4LA/GbyHFCsx8LB9crtRvO3AhMXyFsUin2QtoQDIUEhtbJqWGsQN\r
36 X-Received: by 10.15.41.140 with SMTP id s12mr43313483eev.4.1394565849909;\r
37         Tue, 11 Mar 2014 12:24:09 -0700 (PDT)\r
38 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
39         [88.195.111.91]) by mx.google.com with ESMTPSA id\r
40         cb5sm60793104eeb.18.2014.03.11.12.24.08 for <multiple recipients>\r
41         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
42         Tue, 11 Mar 2014 12:24:09 -0700 (PDT)\r
43 From: Jani Nikula <jani@nikula.org>\r
44 To: notmuch@notmuchmail.org\r
45 Subject: [PATCH] test: conditionally test compact depending on configured\r
46         support\r
47 Date: Tue, 11 Mar 2014 21:24:07 +0200\r
48 Message-Id: <1394565847-26795-1-git-send-email-jani@nikula.org>\r
49 X-Mailer: git-send-email 1.9.0\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Tue, 11 Mar 2014 19:24:18 -0000\r
63 \r
64 I still have one machine with old enough Xapian to not have compaction\r
65 support. Make the tests check for unsupported compact operation when\r
66 compact is not available.\r
67 ---\r
68  test/Makefile.local  |  9 +++++++++\r
69  test/T020-compact.sh | 11 +++++++++++\r
70  2 files changed, 20 insertions(+)\r
71 \r
72 diff --git a/test/Makefile.local b/test/Makefile.local\r
73 index 36b1c1b71de0..8befa40dfaa4 100644\r
74 --- a/test/Makefile.local\r
75 +++ b/test/Makefile.local\r
76 @@ -35,9 +35,18 @@ $(dir)/symbol-test: $(dir)/symbol-test.o lib/$(LINKER_NAME)\r
77  $(dir)/parse-time: $(dir)/parse-time.o parse-time-string/parse-time-string.o\r
78         $(call quiet,CC) $^ -o $@\r
79  \r
80 +$(dir)/have-compact: Makefile.config\r
81 +ifeq ($(HAVE_XAPIAN_COMPACT),1)\r
82 +       echo -n "#!/bin/sh\nexit 0\n" > $@\r
83 +else\r
84 +       echo -n "#!/bin/sh\nexit 1\n" > $@\r
85 +endif\r
86 +       chmod +x $@\r
87 +\r
88  .PHONY: test check\r
89  \r
90  TEST_BINARIES=$(dir)/arg-test \\r
91 +             $(dir)/have-compact \\r
92               $(dir)/hex-xcode \\r
93               $(dir)/random-corpus \\r
94               $(dir)/parse-time \\r
95 diff --git a/test/T020-compact.sh b/test/T020-compact.sh\r
96 index ac174cec7111..77bb9632cb11 100755\r
97 --- a/test/T020-compact.sh\r
98 +++ b/test/T020-compact.sh\r
99 @@ -10,6 +10,17 @@ notmuch tag +tag1 \*\r
100  notmuch tag +tag2 subject:Two\r
101  notmuch tag -tag1 +tag3 subject:Three\r
102  \r
103 +if ! ${TEST_DIRECTORY}/have-compact; then\r
104 +    test_begin_subtest "Compact unsupported: error message"\r
105 +    output=$(notmuch compact --quiet 2>&1)\r
106 +    test_expect_equal "$output" "notmuch was compiled against a xapian version lacking compaction support.\r
107 +Compaction failed: Unsupported operation"\r
108 +\r
109 +    test_expect_code 1 "Compact unsupported: status code" "notmuch compact"\r
110 +\r
111 +    test_done\r
112 +fi\r
113 +\r
114  test_expect_success "Running compact" "notmuch compact --backup=${TEST_DIRECTORY}/xapian.old"\r
115  \r
116  test_begin_subtest "Compact preserves database"\r
117 -- \r
118 1.9.0\r
119 \r