Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 4a / 03c12c78c580ac450e8697a42e0b8f98193d73
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 611E86DE034D\r
6  for <notmuch@notmuchmail.org>; Fri,  8 Apr 2016 18:50:15 -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.02\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.02 tagged_above=-999 required=5 tests=[AWL=-0.009,\r
12   SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id 7UyyUTitiDCC for <notmuch@notmuchmail.org>;\r
16  Fri,  8 Apr 2016 18:50:07 -0700 (PDT)\r
17 Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
18  by arlo.cworth.org (Postfix) with ESMTPS id E99806DE02C6\r
19  for <notmuch@notmuchmail.org>; Fri,  8 Apr 2016 18:49:59 -0700 (PDT)\r
20 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
21  (envelope-from <bremner@tethera.net>)\r
22  id 1aoi2K-00022S-S3; Fri, 08 Apr 2016 21:50:08 -0400\r
23 Received: (nullmailer pid 6638 invoked by uid 1000);\r
24  Sat, 09 Apr 2016 01:49:55 -0000\r
25 From: David Bremner <david@tethera.net>\r
26 To: notmuch@notmuchmail.org\r
27 Subject: [PATCH 4/4] test: cope with glass backend file naming variations\r
28 Date: Fri,  8 Apr 2016 22:49:50 -0300\r
29 Message-Id: <1460166590-6526-5-git-send-email-david@tethera.net>\r
30 X-Mailer: git-send-email 2.8.0.rc3\r
31 In-Reply-To: <1460166590-6526-1-git-send-email-david@tethera.net>\r
32 References: <1460166590-6526-1-git-send-email-david@tethera.net>\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.20\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37  <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
39  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
44  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Sat, 09 Apr 2016 01:50:15 -0000\r
46 \r
47 In several places in the test suite we intentionally corrupt the Xapian\r
48 database in order to test error handling. This corruption is specific to\r
49 the on-disk organization of the database, and that changed with the\r
50 glass backend. We use the previously computed default backend to make\r
51 the tests adapt to changing names.\r
52 ---\r
53  test/T050-new.sh           | 2 +-\r
54  test/T060-count.sh         | 4 ++--\r
55  test/T150-tagging.sh       | 4 ++--\r
56  test/T360-symbol-hiding.sh | 4 ++--\r
57  test/T560-lib-error.sh     | 4 ++--\r
58  5 files changed, 9 insertions(+), 9 deletions(-)\r
59 \r
60 diff --git a/test/T050-new.sh b/test/T050-new.sh\r
61 index 93a6fa9..df9e89a 100755\r
62 --- a/test/T050-new.sh\r
63 +++ b/test/T050-new.sh\r
64 @@ -284,7 +284,7 @@ notmuch config set new.tags $OLDCONFIG\r
65  \r
66  \r
67  test_begin_subtest "Xapian exception: read only files"\r
68 -chmod u-w  ${MAIL_DIR}/.notmuch/xapian/*.DB\r
69 +chmod u-w  ${MAIL_DIR}/.notmuch/xapian/*.${db_ending}\r
70  output=$(NOTMUCH_NEW --debug 2>&1 | sed 's/: .*$//' )\r
71  chmod u+w  ${MAIL_DIR}/.notmuch/xapian/*.DB\r
72  test_expect_equal "$output" "A Xapian exception occurred opening database"\r
73 diff --git a/test/T060-count.sh b/test/T060-count.sh\r
74 index 3fec94e..0ac8314 100755\r
75 --- a/test/T060-count.sh\r
76 +++ b/test/T060-count.sh\r
77 @@ -95,7 +95,7 @@ test_expect_equal_file EXPECTED OUTPUT\r
78  \r
79  backup_database\r
80  test_begin_subtest "error message for database open"\r
81 -dd if=/dev/zero of="${MAIL_DIR}/.notmuch/xapian/postlist.DB" count=3\r
82 +dd if=/dev/zero of="${MAIL_DIR}/.notmuch/xapian/postlist.${db_ending}" count=3\r
83  notmuch count '*' 2>OUTPUT 1>/dev/null\r
84  output=$(sed 's/^\(A Xapian exception [^:]*\):.*$/\1/' OUTPUT)\r
85  test_expect_equal "${output}" "A Xapian exception occurred opening database"\r
86 @@ -105,7 +105,7 @@ cat <<EOF > count-files.gdb\r
87  set breakpoint pending on\r
88  break count_files\r
89  commands\r
90 -shell cp /dev/null ${MAIL_DIR}/.notmuch/xapian/postlist.DB\r
91 +shell cp /dev/null ${MAIL_DIR}/.notmuch/xapian/postlist.${db_ending}\r
92  continue\r
93  end\r
94  run\r
95 diff --git a/test/T150-tagging.sh b/test/T150-tagging.sh\r
96 index 8adcabc..6fd6a18 100755\r
97 --- a/test/T150-tagging.sh\r
98 +++ b/test/T150-tagging.sh\r
99 @@ -287,9 +287,9 @@ test_expect_code 1 "Empty tag names" 'notmuch tag + One'\r
100  test_expect_code 1 "Tag name beginning with -" 'notmuch tag +- One'\r
101  \r
102  test_begin_subtest "Xapian exception: read only files"\r
103 -chmod u-w  ${MAIL_DIR}/.notmuch/xapian/*.DB\r
104 +chmod u-w  ${MAIL_DIR}/.notmuch/xapian/*.${db_ending}\r
105  output=$(notmuch tag +something '*' 2>&1 | sed 's/: .*$//' )\r
106 -chmod u+w  ${MAIL_DIR}/.notmuch/xapian/*.DB\r
107 +chmod u+w  ${MAIL_DIR}/.notmuch/xapian/{*.DB,*.glass}\r
108  test_expect_equal "$output" "A Xapian exception occurred opening database"\r
109  \r
110  test_done\r
111 diff --git a/test/T360-symbol-hiding.sh b/test/T360-symbol-hiding.sh\r
112 index 89e7f16..3f18ec1 100755\r
113 --- a/test/T360-symbol-hiding.sh\r
114 +++ b/test/T360-symbol-hiding.sh\r
115 @@ -15,11 +15,11 @@ test_begin_subtest 'running test' run_test\r
116  mkdir -p ${PWD}/fakedb/.notmuch\r
117  ( LD_LIBRARY_PATH="$TEST_DIRECTORY/../lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \\r
118                  $TEST_DIRECTORY/symbol-test ${PWD}/fakedb ${PWD}/nonexistent \\r
119 -                2>&1 | notmuch_dir_sanitize | sed "s,\`,\',g") > OUTPUT\r
120 +                2>&1 | notmuch_dir_sanitize | sed -e "s,\`,\',g" -e "s,${NOTMUCH_DEFAULT_XAPIAN_BACKEND},backend,g") > OUTPUT\r
121  \r
122  cat <<EOF > EXPECTED\r
123  A Xapian exception occurred opening database: Couldn't stat 'CWD/fakedb/.notmuch/xapian'\r
124 -caught No chert database found at path 'CWD/nonexistent'\r
125 +caught No backend database found at path 'CWD/nonexistent'\r
126  EOF\r
127  test_expect_equal_file EXPECTED OUTPUT\r
128  \r
129 diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh\r
130 index 49d3674..087c6bd 100755\r
131 --- a/test/T560-lib-error.sh\r
132 +++ b/test/T560-lib-error.sh\r
133 @@ -189,7 +189,7 @@ Path already exists: MAIL_DIR\r
134  EOF\r
135  test_expect_equal_file EXPECTED OUTPUT\r
136  \r
137 -cat <<'EOF' > c_head\r
138 +cat <<EOF > c_head\r
139  #include <stdio.h>\r
140  #include <sys/types.h>\r
141  #include <sys/stat.h>\r
142 @@ -210,7 +210,7 @@ int main (int argc, char** argv)\r
143       fprintf (stderr, "error opening database: %d %s\n", stat, msg ? msg : "");\r
144       exit (1);\r
145     }\r
146 -   path = talloc_asprintf (db, "%s/.notmuch/xapian/postlist.DB", argv[1]);\r
147 +   path = talloc_asprintf (db, "%s/.notmuch/xapian/postlist.${db_ending}", argv[1]);\r
148     fd = open(path,O_WRONLY|O_TRUNC);\r
149     if (fd < 0) {\r
150         fprintf (stderr, "error opening %s\n", argv[1]);\r
151 -- \r
152 2.8.0.rc3\r
153 \r