Gentoo Archives: gentoo-commits

From: "Amadeusz Zolnowski (aidecoe)" <aidecoe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-mail/notmuch/files: 0.10.1-fix-test-build.patch
Date: Fri, 02 Dec 2011 08:39:04
Message-Id: 20111202083853.C742A2004C@flycatcher.gentoo.org
1 aidecoe 11/12/02 08:38:53
2
3 Added: 0.10.1-fix-test-build.patch
4 Log:
5 net-mail/notmuch: Version bump to 0.10.1.
6
7 (Portage version: 2.1.10.39/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 net-mail/notmuch/files/0.10.1-fix-test-build.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-mail/notmuch/files/0.10.1-fix-test-build.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-mail/notmuch/files/0.10.1-fix-test-build.patch?rev=1.1&content-type=text/plain
14
15 Index: 0.10.1-fix-test-build.patch
16 ===================================================================
17 From dc1fae07d2896d9eace61989b7c25d9434ee7f3f Mon Sep 17 00:00:00 2001
18 From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@×××××××.name>
19 Date: Fri, 25 Nov 2011 10:08:47 +0100
20 Subject: [PATCH] Build symbol-test with make instead of hardcoding in
21 symbol-hiding.
22
23 If symbol-test is built in symbol-hiding with hardcoded g++ invokation, it's
24 not so easy to pass $(srcdir) which is required to find notmuch.h when srcdir
25 and builddir are separate directories.
26
27 Fixed warnings in symbol-test.cc, btw.
28 ---
29 test/.gitignore | 1 +
30 test/Makefile.local | 5 ++++-
31 test/basic | 2 +-
32 test/symbol-hiding | 3 +--
33 test/symbol-test.cc | 9 ++++-----
34 5 files changed, 11 insertions(+), 9 deletions(-)
35
36 diff --git a/test/.gitignore b/test/.gitignore
37 index 9e97052..7e30e8d 100644
38 --- a/test/.gitignore
39 +++ b/test/.gitignore
40 @@ -1,4 +1,5 @@
41 test-results
42 corpus.mail
43 smtp-dummy
44 +symbol-test
45 tmp.*
46 diff --git a/test/Makefile.local b/test/Makefile.local
47 index 8eb0433..a672fd3 100644
48 --- a/test/Makefile.local
49 +++ b/test/Makefile.local
50 @@ -11,8 +11,11 @@ smtp_dummy_modules = $(smtp_dummy_srcs:.c=.o)
51 $(dir)/smtp-dummy: $(smtp_dummy_modules)
52 $(call quiet,CC) $^ -o $@
53
54 +$(dir)/symbol-test: $(dir)/symbol-test.o
55 + $(call quiet,CC) $^ -o $@ -Llib -lnotmuch -lxapian
56 +
57 .PHONY: test check
58 -test: all $(dir)/smtp-dummy
59 +test: all $(dir)/smtp-dummy $(dir)/symbol-test
60 @${dir}/notmuch-test $(OPTIONS)
61
62 check: test
63 diff --git a/test/basic b/test/basic
64 index 38db2ba..5463bf8 100755
65 --- a/test/basic
66 +++ b/test/basic
67 @@ -56,7 +56,7 @@ tests_in_suite=$(for i in $TESTS; do echo $i; done | sort)
68 available=$(ls -1 $TEST_DIRECTORY/ | \
69 sed -r -e "/^(aggregate-results.sh|Makefile|Makefile.local|notmuch-test)/d" \
70 -e "/^(README|test-lib.sh|test-lib.el|test-results|tmp.*|valgrind|corpus*)/d" \
71 - -e "/^(emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose|symbol-test.cc)/d" \
72 + -e "/^(emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose|symbol-test.cc|symbol-test|symbol-test.o)/d" \
73 -e "/^(test.expected-output|.*~)/d" \
74 -e "/^(gnupg-secret-key.asc)/d" \
75 -e "/^(gnupg-secret-key.NOTE)/d" \
76 diff --git a/test/symbol-hiding b/test/symbol-hiding
77 index d0b31ae..f67b653 100755
78 --- a/test/symbol-hiding
79 +++ b/test/symbol-hiding
80 @@ -12,13 +12,12 @@ test_description='exception symbol hiding'
81 . ./test-lib.sh
82
83 run_test(){
84 - result=$(LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib ./symbol-test 2>&1)
85 + result=$(LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib $TEST_DIRECTORY/symbol-test 2>&1)
86 }
87
88 output="A Xapian exception occurred opening database: Couldn't stat 'fakedb/.notmuch/xapian'
89 caught No chert database found at path \`./nonexistant'"
90
91 -g++ -o symbol-test -I$TEST_DIRECTORY/../lib $TEST_DIRECTORY/symbol-test.cc -L$TEST_DIRECTORY/../lib -lnotmuch -lxapian
92 mkdir -p fakedb/.notmuch
93 test_expect_success 'running test' run_test
94 test_begin_subtest 'checking output'
95 diff --git a/test/symbol-test.cc b/test/symbol-test.cc
96 index 1de06ea..bfbe38f 100644
97 --- a/test/symbol-test.cc
98 +++ b/test/symbol-test.cc
99 @@ -1,14 +1,13 @@
100 #include <stdio.h>
101 #include <xapian.h>
102 #include <notmuch.h>
103 -main (int argc, char **argv){
104 +int main (){
105
106 - notmuch_database_t *notmuch
107 - = notmuch_database_open ("fakedb",
108 - NOTMUCH_DATABASE_MODE_READ_ONLY);
109 + //notmuch_database_t *notmuch =
110 + notmuch_database_open ("fakedb", NOTMUCH_DATABASE_MODE_READ_ONLY);
111
112 try{
113 - (void)new Xapian::WritableDatabase ("./nonexistant", Xapian::DB_OPEN);
114 + (void)new Xapian::WritableDatabase ("./nonexistant", Xapian::DB_OPEN);
115 } catch (const Xapian::Error &error) {
116 printf("caught %s\n",error.get_msg().c_str());
117 return 0;
118 --
119 1.7.8.rc3