]> git.notmuchmail.org Git - notmuch/commitdiff
test/symbol-hiding: compare exported symbols with existing one
authorDavid Bremner <bremner@debian.org>
Tue, 29 Nov 2011 06:51:16 +0000 (22:51 -0800)
committerDavid Bremner <bremner@debian.org>
Wed, 7 Dec 2011 23:56:01 +0000 (19:56 -0400)
We assume that any symbol starting with notmuch_ in lib/*.o should be
exported, and that only those symbols should be exported.

test/symbol-hiding

index 6d4e4fff001742111ec47ad84bbbf6e333a421b1..68f0d1b183c9acd29f90721ced1960fd1eac4ffa 100755 (executable)
@@ -24,4 +24,10 @@ test_expect_success 'running test' run_test
 
 test_begin_subtest 'checking output'
 test_expect_equal "$result" "$output" 
+
+test_begin_subtest 'comparing existing to exported symbols'
+objdump -t $TEST_DIRECTORY/../lib/*.o | awk '$4 == ".text" && $6 ~ "^notmuch" {print $6}' | sort | uniq > ACTUAL
+sed -n 's/[[:blank:]]*\(notmuch_[^;]*\);/\1/p' $TEST_DIRECTORY/../notmuch.sym | sort | uniq > EXPORTED
+test_expect_equal_file EXPORTED ACTUAL
+
 test_done