[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / 91 / e5e2626d867232fae833d74be5c3abb5e35265
1 Return-Path: <bremner@tethera.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 arlo.cworth.org (Postfix) with ESMTP id 292706DE091C\r
6  for <notmuch@notmuchmail.org>; Sat,  4 Jun 2016 05:29:59 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.012\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.012 tagged_above=-999 required=5\r
12  tests=[AWL=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01]\r
13  autolearn=disabled\r
14 Received: from arlo.cworth.org ([127.0.0.1])\r
15  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
16  with ESMTP id A5hDbifBI6dc for <notmuch@notmuchmail.org>;\r
17  Sat,  4 Jun 2016 05:29:51 -0700 (PDT)\r
18 Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
19  by arlo.cworth.org (Postfix) with ESMTPS id 8A5886DE0261\r
20  for <notmuch@notmuchmail.org>; Sat,  4 Jun 2016 05:29:34 -0700 (PDT)\r
21 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
22  (envelope-from <bremner@tethera.net>)\r
23  id 1b9Ahc-0004z6-SF; Sat, 04 Jun 2016 08:29:20 -0400\r
24 Received: (nullmailer pid 23495 invoked by uid 1000);\r
25  Sat, 04 Jun 2016 12:29:27 -0000\r
26 From: David Bremner <david@tethera.net>\r
27 To: Istvan Marko <notmuch@kismala.com>, Jani Nikula <jani@nikula.org>,\r
28  notmuch@notmuchmail.org\r
29 Subject: [PATCH 3/4] test: initial tests for locking retry\r
30 Date: Sat,  4 Jun 2016 09:29:15 -0300\r
31 Message-Id: <1465043356-23420-4-git-send-email-david@tethera.net>\r
32 X-Mailer: git-send-email 2.8.1\r
33 In-Reply-To: <1465043356-23420-1-git-send-email-david@tethera.net>\r
34 References: <m3wpnb0xc6.fsf@zsu.kismala.com>\r
35  <1465043356-23420-1-git-send-email-david@tethera.net>\r
36 X-BeenThere: notmuch@notmuchmail.org\r
37 X-Mailman-Version: 2.1.20\r
38 Precedence: list\r
39 List-Id: "Use and development of the notmuch mail system."\r
40  <notmuch.notmuchmail.org>\r
41 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
42  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
44 List-Post: <mailto:notmuch@notmuchmail.org>\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
46 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
47  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
48 X-List-Received-Date: Sat, 04 Jun 2016 12:29:59 -0000\r
49 \r
50 Currently there's not much to test, so we simulate contention, and check\r
51 that the modifications to the database are serialized.\r
52 ---\r
53  test/T620-lock.sh | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
54  1 file changed, 75 insertions(+)\r
55  create mode 100755 test/T620-lock.sh\r
56 \r
57 diff --git a/test/T620-lock.sh b/test/T620-lock.sh\r
58 new file mode 100755\r
59 index 0000000..f46475e\r
60 --- /dev/null\r
61 +++ b/test/T620-lock.sh\r
62 @@ -0,0 +1,75 @@\r
63 +#!/usr/bin/env bash\r
64 +test_description="locking"\r
65 +. ./test-lib.sh || exit 1\r
66 +\r
67 +if [ "${NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK}" = "0" ]; then\r
68 +    test_subtest_missing_external_prereq_["lock retry support"]=t\r
69 +fi\r
70 +\r
71 +add_email_corpus\r
72 +\r
73 +test_begin_subtest "blocking open"\r
74 +test_C ${MAIL_DIR} <<'EOF'\r
75 +#include <unistd.h>\r
76 +#include <stdlib.h>\r
77 +#include <sys/wait.h>\r
78 +#include <notmuch-test.h>\r
79 +\r
80 +void\r
81 +taggit (notmuch_database_t *db, const char *tag)\r
82 +{\r
83 +    notmuch_message_t *message;\r
84 +\r
85 +    EXPECT0 (notmuch_database_find_message (db, "4EFC743A.3060609@april.org", &message));\r
86 +    if (message == NULL) {\r
87 +       fprintf (stderr, "unable to find message");\r
88 +       exit (1);\r
89 +    }\r
90 +\r
91 +    EXPECT0 (notmuch_message_add_tag (message, tag));\r
92 +    notmuch_message_destroy (message);\r
93 +}\r
94 +\r
95 +int\r
96 +main (int argc, char **argv)\r
97 +{\r
98 +    pid_t child;\r
99 +    const char *path = argv[1];\r
100 +\r
101 +    child = fork ();\r
102 +    if (child == -1) {\r
103 +       fprintf (stderr, "fork failed\n");\r
104 +       exit (1);\r
105 +    }\r
106 +\r
107 +    if (child == 0) {\r
108 +       notmuch_database_t *db2;\r
109 +\r
110 +       sleep (1);\r
111 +       EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_WRITE, &db2));\r
112 +       taggit (db2, "child");\r
113 +       EXPECT0 (notmuch_database_close (db2));\r
114 +    } else {\r
115 +       notmuch_database_t *db;\r
116 +\r
117 +       EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_WRITE, &db));\r
118 +       taggit (db, "parent");\r
119 +       sleep (2);\r
120 +       EXPECT0 (notmuch_database_close (db));\r
121 +       wait (NULL);\r
122 +    }\r
123 +}\r
124 +\r
125 +EOF\r
126 +notmuch search --output=tags id:4EFC743A.3060609@april.org >> OUTPUT\r
127 +cat <<'EOF' >EXPECTED\r
128 +== stdout ==\r
129 +== stderr ==\r
130 +child\r
131 +inbox\r
132 +parent\r
133 +unread\r
134 +EOF\r
135 +test_expect_equal_file EXPECTED OUTPUT\r
136 +\r
137 +test_done\r
138 -- \r
139 2.8.1\r
140 \r