[Bug 38840] add coverage analysis to unit tests

John Smith lbalbalba at gmail.com
Sun Aug 5 04:11:55 PDT 2012

On Sun, Aug 5, 2012 at 12:16 PM,  <bugzilla-daemon at freedesktop.org> wrote:
> https://bugs.freedesktop.org/show_bug.cgi?id=38840
> --- Comment #5 from bfoman <bfo.bugmail at spamgourmet.com> 2012-08-05 10:16:44 UTC ---
> Seems there is a trace of gcov work in the source already:
> http://cgit.freedesktop.org/libreoffice/core/tree/sal/qa/helper/gcov
> --

The 'issue' does not really seem to be getting the data at this point.
If I read the man pages of gcov/lcov correctly, it could be as easy as
something like this :

./configure --enable-debug --with-system-libcmis=no
--with-system-saxon=no --with-system-libs

LDFLAGS+='-lgcov' CFLAGS+='-fprofile-arcs -ftest-coverage'
CXXFLAGS+='-fprofile-arcs -ftest-coverage' CPPFLAGS+='-fprofile-arcs
-ftest-coverage' make

lcov --base-directory /usr/local/src/libreoffice --capture --initial
--directory /usr/local/src/libreoffice --output-file

make check

lcov --base-directory /usr/local/src/libreoffice --capture --directory
/usr/local/src/libreoffice --output-file libreoffice_test.info

lcov --add-tracefile libreoffice_base.info --add-tracefile
libreoffice_test.info --output-file libreoffice_total.info

genhtml --demangle-cpp libreoffice_total.info --frames --show-details
--legend --output-directory=/tmp/libreoffice-lcov

But the 'problem' im currently running into, is that LibreOffice wont
build when I specify LDFLAGS/CFLAGS/CXXFLAGS as mentioned above.


John Smith.

More information about the LibreOffice mailing list