Solution needed to UnitTest-ing plug-ins

I’m starting to use the UnitTest class to test various parts of my code.

I already wrote a bunch of UnitTest classes to test algorithms and stuff like that (no GUI elements). All the tests are static objects inside their cpp files and are run at startup with the runAllTests() method.

Now I would like to add some tests for the GUI of the application, but obviously I cannot run those tests at startup because the GUI may not have even been created yet, and I cannot move the whole “runAllTests()” call inside the EditorComponent constructor, for example, because the plug-in may start without the editor being even created and no tests would be performed.

What would you suggest in this case?