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 olra.theworths.org (Postfix) with ESMTP id 037D8429E5F
\r
6 for <notmuch@notmuchmail.org>; Wed, 29 Jun 2011 04:56:51 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_MED=-2.3] 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 PNb+nAlOA+ho for <notmuch@notmuchmail.org>;
\r
16 Wed, 29 Jun 2011 04:56:50 -0700 (PDT)
\r
17 Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])
\r
18 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 11912429E5B
\r
21 for <notmuch@notmuchmail.org>; Wed, 29 Jun 2011 04:56:49 -0700 (PDT)
\r
22 Received: from zancas.localnet
\r
23 (fctnnbsc30w-142167176081.pppoe-dynamic.High-Speed.nb.bellaliant.net
\r
24 [142.167.176.81]) (authenticated bits=0)
\r
25 by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id p5TBuiL3028217
\r
26 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
\r
27 Wed, 29 Jun 2011 08:56:45 -0300
\r
28 Received: from bremner by zancas.localnet with local (Exim 4.76)
\r
29 (envelope-from <bremner@tethera.net>)
\r
30 id 1QbtNs-00055P-GZ; Wed, 29 Jun 2011 08:56:44 -0300
\r
31 From: david@tethera.net
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [PATCH 1/2] test/symbol-hiding: rename to test/libnotmuch-abi,
\r
34 prepare to add more subtests
\r
35 Date: Wed, 29 Jun 2011 08:56:34 -0300
\r
36 Message-Id: <1309348595-19503-1-git-send-email-david@tethera.net>
\r
37 X-Mailer: git-send-email 1.7.5.4
\r
38 Cc: David Bremner <bremner@debian.org>
\r
39 X-BeenThere: notmuch@notmuchmail.org
\r
40 X-Mailman-Version: 2.1.13
\r
42 List-Id: "Use and development of the notmuch mail system."
\r
43 <notmuch.notmuchmail.org>
\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
47 List-Post: <mailto:notmuch@notmuchmail.org>
\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
51 X-List-Received-Date: Wed, 29 Jun 2011 11:56:51 -0000
\r
53 From: David Bremner <bremner@debian.org>
\r
55 Test descriptions changed to accomodate more subtests.
\r
56 The generic 'run_test' is renamed 'run_exception_test',
\r
57 symbol-test(.cc) is renamed exception-test(.cc).
\r
60 I'm not sure if it would be better to start a new test script rather
\r
61 than this fuss about renaming, but "symbol-test.cc" is probably to
\r
62 generic as a name anyway. Arguably exception-test.cc is pretty generic
\r
66 test/exception-test.cc | 17 +++++++++++++++++
\r
67 test/libnotmuch-abi | 26 ++++++++++++++++++++++++++
\r
68 test/notmuch-test | 2 +-
\r
69 test/symbol-hiding | 26 --------------------------
\r
70 test/symbol-test.cc | 17 -----------------
\r
71 6 files changed, 45 insertions(+), 45 deletions(-)
\r
72 create mode 100644 test/exception-test.cc
\r
73 create mode 100755 test/libnotmuch-abi
\r
74 delete mode 100755 test/symbol-hiding
\r
75 delete mode 100644 test/symbol-test.cc
\r
77 diff --git a/test/basic b/test/basic
\r
78 index 33bf711..9b8542f 100755
\r
81 @@ -56,7 +56,7 @@ tests_in_suite=$(for i in $TESTS; do echo $i; done | sort)
\r
82 available=$(ls -1 $TEST_DIRECTORY/ | \
\r
83 sed -r -e "/^(aggregate-results.sh|Makefile|Makefile.local|notmuch-test)/d" \
\r
84 -e "/^(README|test-lib.sh|test-lib.el|test-results|tmp.*|valgrind|corpus*)/d" \
\r
85 - -e "/^(emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose|symbol-test.cc)/d" \
\r
86 + -e "/^(emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose|exception-test.cc)/d" \
\r
87 -e "/^(test.expected-output|.*~)/d" \
\r
88 -e "/^(gnupg-secret-key.asc)/d" \
\r
89 -e "/^(gnupg-secret-key.NOTE)/d" \
\r
90 diff --git a/test/exception-test.cc b/test/exception-test.cc
\r
91 new file mode 100644
\r
92 index 0000000..1de06ea
\r
94 +++ b/test/exception-test.cc
\r
97 +#include <xapian.h>
\r
98 +#include <notmuch.h>
\r
99 +main (int argc, char **argv){
\r
101 + notmuch_database_t *notmuch
\r
102 + = notmuch_database_open ("fakedb",
\r
103 + NOTMUCH_DATABASE_MODE_READ_ONLY);
\r
106 + (void)new Xapian::WritableDatabase ("./nonexistant", Xapian::DB_OPEN);
\r
107 + } catch (const Xapian::Error &error) {
\r
108 + printf("caught %s\n",error.get_msg().c_str());
\r
113 diff --git a/test/libnotmuch-abi b/test/libnotmuch-abi
\r
114 new file mode 100755
\r
115 index 0000000..a7467b8
\r
117 +++ b/test/libnotmuch-abi
\r
119 +#!/usr/bin/env bash
\r
121 +# Copyright (c) 2011 David Bremner
\r
124 +test_description='libnotmuch symbol export and hiding'
\r
126 +# This subtest tests whether hiding Xapian::Error symbols in libnotmuch
\r
127 +# also hides them for other users of libxapian. This is motivated by
\r
128 +# the discussion in http://gcc.gnu.org/wiki/Visibility'
\r
132 +run_exception_test(){
\r
133 + result=$(LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib ./exception-test 2>&1)
\r
136 +output="A Xapian exception occurred opening database: Couldn't stat 'fakedb/.notmuch/xapian'
\r
137 +caught No chert database found at path \`./nonexistant'"
\r
139 +g++ -o exception-test -I$TEST_DIRECTORY/../lib $TEST_DIRECTORY/exception-test.cc -L$TEST_DIRECTORY/../lib -lnotmuch -lxapian
\r
140 +mkdir -p fakedb/.notmuch
\r
141 +test_expect_success 'running exception test' run_exception_test
\r
142 +test_begin_subtest 'checking output'
\r
143 +test_expect_equal "$result" "$output"
\r
145 diff --git a/test/notmuch-test b/test/notmuch-test
\r
146 index fe85c6a..c7296fa 100755
\r
147 --- a/test/notmuch-test
\r
148 +++ b/test/notmuch-test
\r
149 @@ -40,7 +40,7 @@ TESTS="
\r
150 emacs-large-search-buffer
\r
156 TESTS=${NOTMUCH_TESTS:=$TESTS}
\r
158 diff --git a/test/symbol-hiding b/test/symbol-hiding
\r
159 deleted file mode 100755
\r
160 index d0b31ae..0000000
\r
161 --- a/test/symbol-hiding
\r
164 -#!/usr/bin/env bash
\r
166 -# Copyright (c) 2011 David Bremner
\r
169 -# This test tests whether hiding Xapian::Error symbols in libnotmuch
\r
170 -# also hides them for other users of libxapian. This is motivated by
\r
171 -# the discussion in http://gcc.gnu.org/wiki/Visibility'
\r
173 -test_description='exception symbol hiding'
\r
178 - result=$(LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib ./symbol-test 2>&1)
\r
181 -output="A Xapian exception occurred opening database: Couldn't stat 'fakedb/.notmuch/xapian'
\r
182 -caught No chert database found at path \`./nonexistant'"
\r
184 -g++ -o symbol-test -I$TEST_DIRECTORY/../lib $TEST_DIRECTORY/symbol-test.cc -L$TEST_DIRECTORY/../lib -lnotmuch -lxapian
\r
185 -mkdir -p fakedb/.notmuch
\r
186 -test_expect_success 'running test' run_test
\r
187 -test_begin_subtest 'checking output'
\r
188 -test_expect_equal "$result" "$output"
\r
190 diff --git a/test/symbol-test.cc b/test/symbol-test.cc
\r
191 deleted file mode 100644
\r
192 index 1de06ea..0000000
\r
193 --- a/test/symbol-test.cc
\r
196 -#include <stdio.h>
\r
197 -#include <xapian.h>
\r
198 -#include <notmuch.h>
\r
199 -main (int argc, char **argv){
\r
201 - notmuch_database_t *notmuch
\r
202 - = notmuch_database_open ("fakedb",
\r
203 - NOTMUCH_DATABASE_MODE_READ_ONLY);
\r
206 - (void)new Xapian::WritableDatabase ("./nonexistant", Xapian::DB_OPEN);
\r
207 - } catch (const Xapian::Error &error) {
\r
208 - printf("caught %s\n",error.get_msg().c_str());
\r