[PATCH] lib: provide _notmuch_database_log_append
[notmuch-archives.git] / 57 / 5c912f2b8b34fba819bde491c92b3161d1879d
1 Return-Path: <aidecoe@aidecoe.name>\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 0C537431FD0\r
6         for <notmuch@notmuchmail.org>; Fri, 25 Nov 2011 02:09:42 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 XAj6ay55ig2m for <notmuch@notmuchmail.org>;\r
16         Fri, 25 Nov 2011 02:09:41 -0800 (PST)\r
17 Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
18         [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 5280F431FB6\r
21         for <notmuch@notmuchmail.org>; Fri, 25 Nov 2011 02:09:41 -0800 (PST)\r
22 Received: by bkaq10 with SMTP id q10so4504822bka.26\r
23         for <notmuch@notmuchmail.org>; Fri, 25 Nov 2011 02:09:40 -0800 (PST)\r
24 Received: by 10.204.130.90 with SMTP id r26mr33785774bks.46.1322215779221;\r
25         Fri, 25 Nov 2011 02:09:39 -0800 (PST)\r
26 Received: from localhost (abtw56.neoplus.adsl.tpnet.pl. [83.8.168.56])\r
27         by mx.google.com with ESMTPS id jf4sm12751825bkc.5.2011.11.25.02.09.37\r
28         (version=TLSv1/SSLv3 cipher=OTHER);\r
29         Fri, 25 Nov 2011 02:09:38 -0800 (PST)\r
30 From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>\r
31 To: notmuch@notmuchmail.org\r
32 Subject: [PATCH] Build symbol-test with make instead of hardcoding in\r
33         symbol-hiding.\r
34 Date: Fri, 25 Nov 2011 11:09:28 +0100\r
35 Message-Id: <1322215768-4883-1-git-send-email-aidecoe@aidecoe.name>\r
36 X-Mailer: git-send-email 1.7.8.rc3\r
37 In-Reply-To: <1322215147-sup-1990@ittemni>\r
38 References: <1322215147-sup-1990@ittemni>\r
39 Cc: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Fri, 25 Nov 2011 10:09:42 -0000\r
53 \r
54 If symbol-test is built in symbol-hiding with hardcoded g++ invokation, it's\r
55 not so easy to pass $(srcdir) which is required to find notmuch.h when srcdir\r
56 and builddir are separate directories.\r
57 \r
58 Fixed warnings in symbol-test.cc, btw.\r
59 ---\r
60  test/.gitignore     |    1 +\r
61  test/Makefile.local |    5 ++++-\r
62  test/basic          |    2 +-\r
63  test/symbol-hiding  |    3 +--\r
64  test/symbol-test.cc |    9 ++++-----\r
65  5 files changed, 11 insertions(+), 9 deletions(-)\r
66 \r
67 diff --git a/test/.gitignore b/test/.gitignore\r
68 index 9e97052..7e30e8d 100644\r
69 --- a/test/.gitignore\r
70 +++ b/test/.gitignore\r
71 @@ -1,4 +1,5 @@\r
72  test-results\r
73  corpus.mail\r
74  smtp-dummy\r
75 +symbol-test\r
76  tmp.*\r
77 diff --git a/test/Makefile.local b/test/Makefile.local\r
78 index 8eb0433..a672fd3 100644\r
79 --- a/test/Makefile.local\r
80 +++ b/test/Makefile.local\r
81 @@ -11,8 +11,11 @@ smtp_dummy_modules = $(smtp_dummy_srcs:.c=.o)\r
82  $(dir)/smtp-dummy: $(smtp_dummy_modules)\r
83         $(call quiet,CC) $^ -o $@\r
84  \r
85 +$(dir)/symbol-test: $(dir)/symbol-test.o\r
86 +       $(call quiet,CC) $^ -o $@ -Llib -lnotmuch -lxapian\r
87 +\r
88  .PHONY: test check\r
89 -test:  all $(dir)/smtp-dummy\r
90 +test:  all $(dir)/smtp-dummy $(dir)/symbol-test\r
91         @${dir}/notmuch-test $(OPTIONS)\r
92  \r
93  check: test\r
94 diff --git a/test/basic b/test/basic\r
95 index 38db2ba..5463bf8 100755\r
96 --- a/test/basic\r
97 +++ b/test/basic\r
98 @@ -56,7 +56,7 @@ tests_in_suite=$(for i in $TESTS; do echo $i; done | sort)\r
99  available=$(ls -1 $TEST_DIRECTORY/ | \\r
100      sed -r -e "/^(aggregate-results.sh|Makefile|Makefile.local|notmuch-test)/d" \\r
101            -e "/^(README|test-lib.sh|test-lib.el|test-results|tmp.*|valgrind|corpus*)/d" \\r
102 -          -e "/^(emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose|symbol-test.cc)/d" \\r
103 +          -e "/^(emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose|symbol-test.cc|symbol-test|symbol-test.o)/d" \\r
104            -e "/^(test.expected-output|.*~)/d" \\r
105            -e "/^(gnupg-secret-key.asc)/d" \\r
106            -e "/^(gnupg-secret-key.NOTE)/d" \\r
107 diff --git a/test/symbol-hiding b/test/symbol-hiding\r
108 index d0b31ae..f67b653 100755\r
109 --- a/test/symbol-hiding\r
110 +++ b/test/symbol-hiding\r
111 @@ -12,13 +12,12 @@ test_description='exception symbol hiding'\r
112  . ./test-lib.sh\r
113  \r
114  run_test(){\r
115 -    result=$(LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib ./symbol-test 2>&1)\r
116 +    result=$(LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib $TEST_DIRECTORY/symbol-test 2>&1)\r
117  }\r
118  \r
119  output="A Xapian exception occurred opening database: Couldn't stat 'fakedb/.notmuch/xapian'\r
120  caught No chert database found at path \`./nonexistant'"\r
121  \r
122 -g++ -o symbol-test -I$TEST_DIRECTORY/../lib $TEST_DIRECTORY/symbol-test.cc -L$TEST_DIRECTORY/../lib -lnotmuch -lxapian\r
123  mkdir -p fakedb/.notmuch\r
124  test_expect_success 'running test' run_test\r
125  test_begin_subtest 'checking output'\r
126 diff --git a/test/symbol-test.cc b/test/symbol-test.cc\r
127 index 1de06ea..bfbe38f 100644\r
128 --- a/test/symbol-test.cc\r
129 +++ b/test/symbol-test.cc\r
130 @@ -1,14 +1,13 @@\r
131  #include <stdio.h>\r
132  #include <xapian.h>\r
133  #include <notmuch.h>\r
134 -main (int argc, char **argv){\r
135 +int main (){\r
136  \r
137 -    notmuch_database_t *notmuch\r
138 -      = notmuch_database_open ("fakedb",\r
139 -                                    NOTMUCH_DATABASE_MODE_READ_ONLY);\r
140 +  //notmuch_database_t *notmuch =\r
141 +  notmuch_database_open ("fakedb", NOTMUCH_DATABASE_MODE_READ_ONLY);\r
142  \r
143    try{\r
144 -    (void)new Xapian::WritableDatabase ("./nonexistant",                                       Xapian::DB_OPEN);\r
145 +    (void)new Xapian::WritableDatabase ("./nonexistant", Xapian::DB_OPEN);\r
146    } catch (const Xapian::Error &error) {\r
147      printf("caught %s\n",error.get_msg().c_str());\r
148      return 0;\r
149 -- \r
150 1.7.8.rc3\r
151 \r