[PATCH 1/9] lib: read "property" terms from messages.
[notmuch-archives.git] / 5e / 2606d5c254c6fe040b584848afc22538b4c070
1 Return-Path: <schnouki@schnouki.net>\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 C7B94429E21\r
6         for <notmuch@notmuchmail.org>; Mon,  3 Oct 2011 09:48:48 -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.1\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5\r
13         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1]\r
14         autolearn=disabled\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 HYG3Pi2AiS-m for <notmuch@notmuchmail.org>;\r
18         Mon,  3 Oct 2011 09:48:47 -0700 (PDT)\r
19 Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222])\r
20         by olra.theworths.org (Postfix) with ESMTP id 145CB429E26\r
21         for <notmuch@notmuchmail.org>; Mon,  3 Oct 2011 09:48:45 -0700 (PDT)\r
22 Received: from localhost.localdomain (thor.loria.fr [152.81.12.250])\r
23         by ks3536.kimsufi.com (Postfix) with ESMTPSA id AC19E6A06B1;\r
24         Mon,  3 Oct 2011 18:48:43 +0200 (CEST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net;\r
26         s=key-schnouki; t=1317660523;\r
27         bh=n1eDatgbuZkv9TcuAKhbfgpkozfmd93UMFw8y3Zm1tc=;\r
28         h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:\r
29         In-Reply-To:References;\r
30         b=VNpBWuAd4ZunOW2dbGzjd46PtO7xE9+GTq99NH2kJM3NJfSA+ToXEC8xfbKxsA+y6\r
31         MAztVETu37hrDs8YsW8yQ8EQxbLkI+sPCsQz4buciCBQkBJWnslVr0bXFQUolfS9e7\r
32         m3jPhZIliOqH3GVXd0eekNyu3IK27rLipSxwV9y0=\r
33 From: Thomas Jost <schnouki@schnouki.net>\r
34 To: notmuch@notmuchmail.org\r
35 Subject: [PATCH 03/13] test: add 'Emacs' prereq to dependent 'crypto' tests\r
36 Date: Mon,  3 Oct 2011 18:47:17 +0200\r
37 Message-Id: <1317660447-27520-4-git-send-email-schnouki@schnouki.net>\r
38 X-Mailer: git-send-email 1.7.6.4\r
39 In-Reply-To: <1317660447-27520-1-git-send-email-schnouki@schnouki.net>\r
40 References: <1317660447-27520-1-git-send-email-schnouki@schnouki.net>\r
41 In-Reply-To: <871uuuywtt.fsf@convex-new.cs.unb.ca>\r
42 References: <871uuuywtt.fsf@convex-new.cs.unb.ca>\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Mon, 03 Oct 2011 16:48:49 -0000\r
56 \r
57 From: Pieter Praet <pieter@praet.org>\r
58 \r
59 Adds a new test that checks for the presence of 'emacs',\r
60 and adds that test as a prereq to all subsequent tests\r
61 that rely on Emacs.\r
62 \r
63 This causes tests with unmet dependencies to be skipped.\r
64 \r
65 Right now, all crypto tests do depend on Emacs, because it\r
66 is used to generate the signed/encrypted messages that are\r
67 needed by the tests.\r
68 \r
69 Signed-off-by: Pieter Praet <pieter@praet.org>\r
70 ---\r
71  test/crypto |   39 +++++++++++++++++++++++++--------------\r
72  1 files changed, 25 insertions(+), 14 deletions(-)\r
73 \r
74 diff --git a/test/crypto b/test/crypto\r
75 index 4ee318f..cd64275 100755\r
76 --- a/test/crypto\r
77 +++ b/test/crypto\r
78 @@ -7,9 +7,20 @@\r
79  test_description='PGP/MIME signature verification and decryption'\r
80  . ./test-lib.sh\r
81  \r
82 +# Emacs is a prereq.\r
83 +test_set_bin_prereq screen "GNU Screen" SCREEN\r
84 +test_have_prereq SCREEN && test_set_bin_prereq emacs "Emacs" EMACS\r
85 +\r
86  # GnuPG is a prereq.\r
87  test_set_bin_prereq gpg "GnuPG" GPG\r
88  \r
89 +# Some tests have multiple prereqs, but the test_expect_* functions\r
90 +# accept only a single argument as prereq tag, and using test_have_prereq\r
91 +# in and around tests causes various errors for me, so a dirty workaround\r
92 +# will have to do for the time being.\r
93 +test_have_prereq EMACS && test_have_prereq GPG \\r
94 +    && test_set_prereq EMACS+GPG\r
95 +\r
96  \r
97  add_gnupg_home ()\r
98  {\r
99 @@ -36,7 +47,7 @@ test_have_prereq GPG && FINGERPRINT=$(gpg --no-tty --list-secret-keys --with-col\r
100  # although I can't figure out why\r
101  add_email_corpus\r
102  \r
103 -test_expect_success GPG 'emacs delivery of signed message' \\r
104 +test_expect_success EMACS+GPG 'emacs delivery of signed message' \\r
105  'emacs_deliver_message \\r
106      "test signed message 001" \\r
107      "This is a test signed message." \\r
108 @@ -69,7 +80,7 @@ expected='[[[{"id": "XXXXX",\r
109   {"id": 3,\r
110   "content-type": "application/pgp-signature"}]}]},\r
111   []]]]'\r
112 -test_expect_equal GPG \\r
113 +test_expect_equal EMACS+GPG \\r
114      "$output" \\r
115      "$expected"\r
116  \r
117 @@ -104,7 +115,7 @@ expected='[[[{"id": "XXXXX",\r
118   {"id": 3,\r
119   "content-type": "application/pgp-signature"}]}]},\r
120   []]]]'\r
121 -test_expect_equal GPG \\r
122 +test_expect_equal EMACS+GPG \\r
123      "$output" \\r
124      "$expected"\r
125  \r
126 @@ -137,7 +148,7 @@ expected='[[[{"id": "XXXXX",\r
127   {"id": 3,\r
128   "content-type": "application/pgp-signature"}]}]},\r
129   []]]]'\r
130 -test_expect_equal GPG \\r
131 +test_expect_equal EMACS+GPG \\r
132      "$output" \\r
133      "$expected"\r
134  mv "${GNUPGHOME}"{.bak,}\r
135 @@ -146,7 +157,7 @@ mv "${GNUPGHOME}"{.bak,}\r
136  cat <<EOF >TESTATTACHMENT\r
137  This is a test file.\r
138  EOF\r
139 -test_expect_success GPG 'emacs delivery of encrypted message with attachment' \\r
140 +test_expect_success EMACS+GPG 'emacs delivery of encrypted message with attachment' \\r
141  'emacs_deliver_message \\r
142      "test encrypted message 001" \\r
143      "This is a test encrypted message.\n" \\r
144 @@ -180,7 +191,7 @@ Non-text part: application/octet-stream\r
145  \f\r
146 part}\r
147  \f\r
148 body}\r
149  \f\r
150 message}'\r
151 -test_expect_equal GPG \\r
152 +test_expect_equal EMACS+GPG \\r
153      "$output" \\r
154      "$expected"\r
155  \r
156 @@ -215,7 +226,7 @@ expected='[[[{"id": "XXXXX",\r
157   "content-type": "application/octet-stream",\r
158   "filename": "TESTATTACHMENT"}]}]}]},\r
159   []]]]'\r
160 -test_expect_equal GPG \\r
161 +test_expect_equal EMACS+GPG \\r
162      "$output" \\r
163      "$expected"\r
164  \r
165 @@ -226,7 +237,7 @@ output=$(notmuch show --format=json --part=4 --decrypt subject:"test encrypted m\r
166  expected='{"id": 4,\r
167   "content-type": "text/plain",\r
168   "content": "This is a test encrypted message.\n"}'\r
169 -test_expect_equal GPG \\r
170 +test_expect_equal EMACS+GPG \\r
171      "$output" \\r
172      "$expected"\r
173  \r
174 @@ -236,7 +247,7 @@ notmuch show \\r
175      --part=5 \\r
176      --decrypt \\r
177      subject:"test encrypted message 001" >OUTPUT\r
178 -test_expect_equal_file GPG OUTPUT TESTATTACHMENT\r
179 +test_expect_equal_file EMACS+GPG OUTPUT TESTATTACHMENT\r
180  \r
181  test_begin_subtest "decryption failure with missing key"\r
182  mv "${GNUPGHOME}"{,.bak}\r
183 @@ -263,12 +274,12 @@ expected='[[[{"id": "XXXXX",\r
184   {"id": 3,\r
185   "content-type": "application/octet-stream"}]}]},\r
186   []]]]'\r
187 -test_expect_equal GPG \\r
188 +test_expect_equal EMACS+GPG \\r
189      "$output" \\r
190      "$expected"\r
191  mv "${GNUPGHOME}"{.bak,}\r
192  \r
193 -test_expect_success GPG 'emacs delivery of encrypted + signed message' \\r
194 +test_expect_success EMACS+GPG 'emacs delivery of encrypted + signed message' \\r
195  'emacs_deliver_message \\r
196      "test encrypted message 002" \\r
197      "This is another test encrypted message.\n" \\r
198 @@ -303,7 +314,7 @@ expected='[[[{"id": "XXXXX",\r
199   "content-type": "text/plain",\r
200   "content": "This is another test encrypted message.\n"}]}]},\r
201   []]]]'\r
202 -test_expect_equal GPG \\r
203 +test_expect_equal EMACS+GPG \\r
204      "$output" \\r
205      "$expected"\r
206  \r
207 @@ -317,7 +328,7 @@ On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> w\r
208  Non-text part: multipart/encrypted\r
209  Non-text part: application/pgp-encrypted\r
210  > This is another test encrypted message.'\r
211 -test_expect_equal GPG \\r
212 +test_expect_equal EMACS+GPG \\r
213      "$output" \\r
214      "$expected"\r
215  \r
216 @@ -358,7 +369,7 @@ expected='[[[{"id": "XXXXX",\r
217   {"id": 3,\r
218   "content-type": "application/pgp-signature"}]}]},\r
219   []]]]'\r
220 -test_expect_equal GPG \\r
221 +test_expect_equal EMACS+GPG \\r
222      "$output" \\r
223      "$expected"\r
224  \r
225 -- \r
226 1.7.6.4\r
227 \r