[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / 43 / 2726a7b30e2632a7d9e26af8718f7c1f66d7dc
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 1AF1F431FC4\r
6         for <notmuch@notmuchmail.org>; Sun,  9 Mar 2014 14:42:04 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: -0.7\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
13         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id kxwHpCKZdIRu for <notmuch@notmuchmail.org>;\r
17         Sun,  9 Mar 2014 14:41:58 -0700 (PDT)\r
18 Received: from mail-la0-f51.google.com (mail-la0-f51.google.com\r
19         [209.85.215.51]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 05BA4431FC0\r
22         for <notmuch@notmuchmail.org>; Sun,  9 Mar 2014 14:41:05 -0700 (PDT)\r
23 Received: by mail-la0-f51.google.com with SMTP id pv20so4071938lab.24\r
24         for <notmuch@notmuchmail.org>; Sun, 09 Mar 2014 14:41:04 -0700 (PDT)\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
26         d=1e100.net; s=20130820;\r
27         h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
28         :references:in-reply-to:references;\r
29         bh=UKnf5YhA4YqmiCnEmU6V2W69jh5cvxd9Eo/bRGHWN44=;\r
30         b=J7ZhTtGBN+INavbcKF1rdxis0xaIkssFD3I5Yb58xjomQaNnlhcfIpbnJ36t3kuLd6\r
31         /kkfhfGPK5OEZPy4eBD9dTsVBTBLx64RGi+bTWQG/uIC+QTDzxo0t3ek3Ao5h7Ra6QX5\r
32         xqgz9VNW7fVeuOUuS1vnhPhFYxlfCvGYGkDD7U0lAkkFY5FP9RyNteXEcS5EOAMxaAsi\r
33         zjHTAZxIXu+W+atZC9cnlyfLC6aQFsVk9XGXJUtn6SOmE7rb+6HKjPHGxeowffzDUmF0\r
34         Wv+BTL2a5dMdR6jKBYXCloLECKEt8vtT6XcByXcVGzyQKXMIwhjJ9YSxROy4pX1k2r+T\r
35         QpNQ==\r
36 X-Gm-Message-State:\r
37  ALoCoQmHvT+1Rrxt65Q+BXXsPSvMl3S3x6mBWNTWs3T8RUpLff5OsFHHMzuKd8q8FrNMSdkykzRi\r
38 X-Received: by 10.152.18.135 with SMTP id w7mr1567699lad.29.1394401264575;\r
39         Sun, 09 Mar 2014 14:41:04 -0700 (PDT)\r
40 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
41         [88.195.111.91])\r
42         by mx.google.com with ESMTPSA id i7sm26923161lai.5.2014.03.09.14.41.03\r
43         for <multiple recipients>\r
44         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
45         Sun, 09 Mar 2014 14:41:03 -0700 (PDT)\r
46 From: Jani Nikula <jani@nikula.org>\r
47 To: notmuch@notmuchmail.org\r
48 Subject: [PATCH v4 11/13] devel: add script to generate test databases\r
49 Date: Sun,  9 Mar 2014 23:40:32 +0200\r
50 Message-Id:\r
51  <daa61b1fdce346d6dd5b4a7b954227c58c455c6e.1394400503.git.jani@nikula.org>\r
52 X-Mailer: git-send-email 1.9.0\r
53 In-Reply-To: <cover.1394400503.git.jani@nikula.org>\r
54 References: <cover.1394400503.git.jani@nikula.org>\r
55 In-Reply-To: <cover.1394400503.git.jani@nikula.org>\r
56 References: <cover.1394400503.git.jani@nikula.org>\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61         <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Sun, 09 Mar 2014 21:42:04 -0000\r
70 \r
71 Add script to generate notmuch test databases using specified versions\r
72 of notmuch. This is useful for generating material for database\r
73 upgrade tests.\r
74 \r
75 This reuses the test infrastructure to have a sandbox environment for\r
76 notmuch new etc.\r
77 ---\r
78  devel/gen-testdb.sh | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++\r
79  1 file changed, 131 insertions(+)\r
80  create mode 100755 devel/gen-testdb.sh\r
81 \r
82 diff --git a/devel/gen-testdb.sh b/devel/gen-testdb.sh\r
83 new file mode 100755\r
84 index 000000000000..621b31e67fc2\r
85 --- /dev/null\r
86 +++ b/devel/gen-testdb.sh\r
87 @@ -0,0 +1,131 @@\r
88 +#!/usr/bin/env bash\r
89 +#\r
90 +# NAME\r
91 +#      gen-testdb.sh - generate test databases\r
92 +#\r
93 +# SYNOPSIS\r
94 +#      gen-testdb.sh -v NOTMUCH-VERSION [-c CORPUS-PATH] [-s TAR-SUFFIX]\r
95 +#\r
96 +# DESCRIPTION\r
97 +#      Generate a tarball containing the specified test corpus and\r
98 +#      the corresponding notmuch database, indexed using a specific\r
99 +#      version of notmuch, resulting in a specific version of the\r
100 +#      database.\r
101 +#\r
102 +#      The specific version of notmuch will be built on the fly.\r
103 +#      Therefore the script must be run within a git repository to be\r
104 +#      able to build the old versions of notmuch.\r
105 +#\r
106 +#      This script reuses the test infrastructure, and the script\r
107 +#      must be run from within the test directory.\r
108 +#\r
109 +#      The output tarballs, named database-<TAR-SUFFIX>.tar.gz, are\r
110 +#      placed in the test/test-databases directory.\r
111 +#\r
112 +# OPTIONS\r
113 +#      -v NOTMUCH-VERSION\r
114 +#              Notmuch version in terms of a git tag or commit to use\r
115 +#              for generating the database. Required.\r
116 +#\r
117 +#      -c CORPUS-PATH\r
118 +#              Path to a corpus to use for generating the\r
119 +#              database. Due to CWD changes within the test\r
120 +#              infrastructure, use absolute paths. Defaults to the\r
121 +#              test corpus.\r
122 +#\r
123 +#      -s TAR-SUFFIX\r
124 +#              Suffix for the tarball basename. Empty by default.\r
125 +#\r
126 +# EXAMPLE\r
127 +#\r
128 +#      Generate a database indexed with notmuch 0.17. Use the default\r
129 +#      test corpus. Name the tarball database-v1.tar.gz to reflect\r
130 +#      the fact that notmuch 0.17 used database version 1.\r
131 +#\r
132 +#      $ cd test\r
133 +#      $ ../devel/gen-testdb.sh -v 0.17 -s v1\r
134 +#\r
135 +# CAVEATS\r
136 +#      Test infrastructure options won't work.\r
137 +#\r
138 +#      Any existing databases with the same name will be overwritten.\r
139 +#\r
140 +#      It may not be possible to build old versions of notmuch with\r
141 +#      the set of dependencies that satisfy building the current\r
142 +#      version of notmuch.\r
143 +#\r
144 +# AUTHOR\r
145 +#      Jani Nikula <jani@nikula.org>\r
146 +#\r
147 +# LICENSE\r
148 +#      Same as notmuch test infrastructure (GPLv2+).\r
149 +#\r
150 +\r
151 +test_description="database generation abusing test infrastructure"\r
152 +\r
153 +# immediate exit on subtest failure; see test_failure_ in test-lib.sh\r
154 +immediate=t\r
155 +\r
156 +VERSION=\r
157 +CORPUS=\r
158 +SUFFIX=\r
159 +\r
160 +while getopts v:c:s: opt; do\r
161 +    case "$opt" in\r
162 +       v) VERSION="$OPTARG";;\r
163 +       c) CORPUS="$OPTARG";;\r
164 +       s) SUFFIX="-$OPTARG";;\r
165 +    esac\r
166 +done\r
167 +shift `expr $OPTIND - 1`\r
168 +\r
169 +. ./test-lib.sh\r
170 +\r
171 +SHORT_CORPUS=$(basename ${CORPUS:-database})\r
172 +DBNAME=${SHORT_CORPUS}${SUFFIX}\r
173 +TARBALLNAME=${DBNAME}.tar.xz\r
174 +\r
175 +CORPUS=${CORPUS:-${TEST_DIRECTORY}/corpus}\r
176 +\r
177 +test_expect_code 0 "notmuch version specified on the command line" \\r
178 +    "test -n ${VERSION}"\r
179 +\r
180 +test_expect_code 0 "the specified version ${VERSION} refers to a commit" \\r
181 +    "git show ${VERSION} >/dev/null 2>&1"\r
182 +\r
183 +BUILD_DIR="notmuch-${VERSION}"\r
184 +test_expect_code 0 "generate snapshot of notmuch version ${VERSION}" \\r
185 +    "git -C $TEST_DIRECTORY/.. archive --prefix=${BUILD_DIR}/ --format=tar ${VERSION} | tar x"\r
186 +\r
187 +# force version string\r
188 +git describe --match '[0-9.]*' ${VERSION} > ${BUILD_DIR}/version\r
189 +\r
190 +test_expect_code 0 "configure and build notmuch version ${VERSION}" \\r
191 +    "make -C ${BUILD_DIR}"\r
192 +\r
193 +# use the newly built notmuch\r
194 +export PATH=./${BUILD_DIR}:$PATH\r
195 +\r
196 +test_begin_subtest "verify the newly built notmuch version"\r
197 +test_expect_equal "`notmuch --version`" "notmuch `cat ${BUILD_DIR}/version`"\r
198 +\r
199 +# replace the existing mails, if any, with the specified corpus\r
200 +rm -rf ${MAIL_DIR}\r
201 +cp -a ${CORPUS} ${MAIL_DIR}\r
202 +\r
203 +test_expect_code 0 "index the corpus" \\r
204 +    "notmuch new"\r
205 +\r
206 +# wrap the resulting mail store and database in a tarball\r
207 +\r
208 +cp -a ${MAIL_DIR} ${TMP_DIRECTORY}/${DBNAME}\r
209 +tar Jcf ${TMP_DIRECTORY}/${TARBALLNAME} -C ${TMP_DIRECTORY} ${DBNAME}\r
210 +mkdir -p  ${TEST_DIRECTORY}/test-databases\r
211 +cp -a ${TMP_DIRECTORY}/${TARBALLNAME} ${TEST_DIRECTORY}/test-databases\r
212 +test_expect_code 0 "create the output tarball ${TARBALLNAME}" \\r
213 +    "test -f ${TEST_DIRECTORY}/test-databases/${TARBALLNAME}"\r
214 +\r
215 +# generate a checksum file\r
216 +test_expect_code 0 "compute checksum" \\r
217 +    "(cd ${TEST_DIRECTORY}/test-databases/ && sha256sum ${TARBALLNAME} > ${TARBALLNAME}.sha256)"\r
218 +test_done\r
219 -- \r
220 1.9.0\r
221 \r