[Libreoffice] visibility markup and tests, gotchas
Caolán McNamara
caolanm at redhat.com
Wed Sep 7 03:58:21 PDT 2011
For the cppunit tests there's a wrinkle in that to be able to use
symbols which have been visibility marked up to be *private* the .o
files with those symbols need to be linked into the test shared lib.
e.g. sc's ucalc an sw'd swdoc-test cppunit tests are these
When the visibility of the symbols required by a test are public the
test shared lib can just be linked to the shared lib in which the
symbols live, e.g. sc's and sw's filters-test are these, as are most
tests.
There's a gotcha if you have e.g. the sw swdoc-test test which is linked
together from the same .o's which go into libsw and then get your test
to dlopen something which links to the *real* libsw, i.e. duplicate
symbols and "weird things happen".
i.e. the .doc and .rtf filters in sw are implemented by a libmsword.so
which links to libsw. *If* the .doc and .rtf filter tests were in
swdoc-test then they will fail in some very odd and hard-to-debug ways
seeing as libswdoctest.so would end up dlopening indirectly libmsword.so
which is linked to libsw.so which comprises of copies of the same .os as
comprise libswdoctest.so
Anyway, that's why the filters-test in sw and sc are separate from the
"fat" test of the internal apis.
C.
More information about the LibreOffice
mailing list