Accessing main window menus during C++ test run

Colomban Wendling cwendling at hypra.fr
Tue Jun 21 14:04:34 UTC 2022


Hi Miklos,

Le 17/06/2022 à 08:28, Miklos Vajna a écrit :
> […]
> 
> Hmm, so far you tried out of process + SAL_USE_VCLPLUGIN=svp and
> in-process + --headless.
> 
> Try experimenting with the in-process + SAL_USE_VCLPLUGIN=svp
> combination, perhaps that would give you what you need.

OK I played with this (after digging around on how the test was actually 
launched), and --headless actually has nothing to do with my issue: the 
reason I don't see menus is because of 
test/user-template/registry/modifications.xcd from 
gb_CppunitTest_use_configuration, which overrides all UI config, and 
thus menu and toolbar contents, and places nothing in them.

I'm not sure what's the use of these UIConfig overrides in the first 
place as I can't seem to track the history down to something useful, but 
anyway: how would I de-override that for a specific test?

I figured I could use gb_CppunitTest_use_instdir_configuration instead 
of gb_CppunitTest_use_configuration so that drops that part of it, but 
the unittest overrides also seem to contain useful stuff like locale, 
font set, file locking options, etc. that I probably should be using.

In any case, thanks a lot for the suggestions, that lead me to playing 
with the right bit :)

> Be aware that in case of in-process tests your test code is running on
> the main thread, so if you depend on any idles, you need to manually
> spin the main loop with Scheduler::ProcessEventsToIdle() (vs out of
> process tests, where this is done for you automatically).

Yeah thanks, I already am doing some of this, but I indeed might need to 
be careful about it, and possibly use event handlers in some places.

Regards,
Colomban


More information about the LibreOffice mailing list