how to run single cppunit tests

Markus Mohrhard markus.mohrhard at googlemail.com
Fri Aug 31 19:14:48 UTC 2018


Hey,

On Fri, Aug 31, 2018 at 6:06 PM Rahul Gurung <gurungrahul2 at gmail.com> wrote:

> hey,
>
> can you tell me how to run a single and specific cpp test to check if it
> is working or not? I tried the methods told in the documentation it didn't
> work for me,(as a whole lot of unrelated tests started running) I think I
> am doing it wrong somewhere, so I need you to tell the exact command,
> taking a specific test into consideration is going to be helpful.
>


So there are two parts to it.

There is the CPPUNIT_TEST_NAME environment variable that you can use to
select a single test case from a whole test suite. E.g. from your recent
patch: CPPUNIT_TEST_NAME="sc_apitest::ScCellCursorObj::testGoToEnd" make
CppunitTest_sc_cellcursorobj would have just executed that one single case
from the whole test suite.

The make CppunitTest_sc_cellcursorobj part only rebuilds the corresponding
test and all its dependencies however if you call it from the top level
this means it will always rebuild a few targets that have not changed.
Often it is easier to switch to the corresponding module, in that case sc,
and run make -sr CppunitTest_sc_cellcursorobj, which will only rebuild
changed dependencies in the corresponding module.

Regards,
Markus

Thank,
> Rahul Gurung.
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20180831/3bc249a5/attachment.html>


More information about the LibreOffice mailing list