[PATCH 2/2] test/libnotmuch-abi: compare exported symbols, available symbols, and linker script.

david at tethera.net david at tethera.net
Wed Jun 29 04:56:35 PDT 2011


From: David Bremner <bremner at debian.org>

This uses objdump and awk to grab the available "notmuch_" symbols
from the object files and all exported symbols from libnotmuch.so. The
symbols from the linker script are grabbed using sed.  All three of
these sets of symbols should be equal.
---
 test/libnotmuch-abi |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/test/libnotmuch-abi b/test/libnotmuch-abi
index a7467b8..0e6192b 100755
--- a/test/libnotmuch-abi
+++ b/test/libnotmuch-abi
@@ -23,4 +23,14 @@ mkdir -p fakedb/.notmuch
 test_expect_success 'running exception test' run_exception_test
 test_begin_subtest 'checking output'
 test_expect_equal "$result" "$output" 
+
+objdump -t $TEST_DIRECTORY/../lib/*.o | awk '$4 == ".text" && $6 ~ "^notmuch" {print $6}' | sort | uniq >  all-symbols.txt
+
+test_begin_subtest 'checking linker script'
+sed -n 's/^\s*\(notmuch_.*\);/\1/p' $TEST_DIRECTORY/../notmuch.sym | sort> script-symbols.txt
+test_expect_equal_file all-symbols.txt script-symbols.txt
+
+test_begin_subtest 'comparing exported symbols'
+objdump -T $TEST_DIRECTORY/../lib/libnotmuch.so | awk '$4 == ".text" {print $7}' | sort | uniq >  lib-symbols.txt
+test_expect_equal_file all-symbols.txt lib-symbols.txt
 test_done
-- 
1.7.5.4



More information about the notmuch mailing list