Re: [PATCH] tests: add a test for symbol hiding side effects

Subject: Re: [PATCH] tests: add a test for symbol hiding side effects

Date: Thu, 23 Jun 2011 07:24:08 -0300

To: notmuch@notmuchmail.org

Cc:

From: David Bremner


On Wed, 22 Jun 2011 09:02:36 -0300, david@tethera.net wrote:
> From: David Bremner <bremner@debian.org>
> 
> The worry here is that a binary linking with libnotmuch might lose
> access to Xapian::Error symbols because libnotmuch hides them.

After some helpful feedback from jrollins and amdragon on IRC, I have
pushed an updated version of this. The guts of the updated test are as
follows:

run_test(){
    result=$(LD_LIBRARY_PATH=../../lib ./symbol-test 2>&1)
}

output="A Xapian exception occurred opening database: Couldn't stat 'fakedb/.notmuch/xapian'
caught No chert database found at path \`./nonexistant'"

g++ -o symbol-test -I../../lib ../symbol-test.cc -L../../lib -lnotmuch -lxapian
mkdir -p fakedb/.notmuch
test_expect_success 'running test' run_test
test_begin_subtest 'checking output'
test_expect_equal "$result" "$output" 
test_done

Thread: