[test] Using boost.test for GUI testing?

Hello, did anybody ever use boost.test to test the UI behavior of classes, like for example instantiating a class implementing a dialog, sending some events to the resulting object, and checking that the object has the expected state. AFAICT this would require to somehow integrate the main event loop of the respective GUI framework with the main loop of boost test, but I'm at a loss how this could be accomplished. Has anybody any experience to share? Best regards, Markus

Markus Schöpflin wrote:
Hello,
did anybody ever use boost.test to test the UI behavior of classes, like for example instantiating a class implementing a dialog, sending some events to the resulting object, and checking that the object has the expected state.
AFAICT this would require to somehow integrate the main event loop of the respective GUI framework with the main loop of boost test, but I'm at a loss how this could be accomplished.
Has anybody any experience to share?
I'm not sure exactly what you have in mind but I have used boost.test to help test UIs using the approach outlined in the Taligent MVP paper. <http://www.wildcrest.com/Potel/Portfolio/mvp.pdf> I'd recommend having a read of that to help with ideas. Follow-up searches should reveal more interesting examples. Jamie

Jamie Allsop wrote:
I'm not sure exactly what you have in mind but I have used boost.test to help test UIs using the approach outlined in the Taligent MVP paper. <http://www.wildcrest.com/Potel/Portfolio/mvp.pdf> I'd recommend having a read of that to help with ideas. Follow-up searches should reveal more interesting examples.
Thank you for your answer. I can see how you would go about testing the model and the controller classes, but how about the views? Did you do automatic testing of these as well? If yes, how did you integrate the event loop of the GUI framework in boost.test, or vice versa? In my case, I have a legacy application based on Motif/X11 for which I would like to come up with a unit test suite. Unfortunately, it doesn't follow any clear MVC or MVP pattern, it's a jumble of model, view, and behavior all mixed together in a bunch of classes. These classes have a method for creating the needed widgets, loading data into these widgets, getting data out of those widgets, and a lot of behind-the-scenery magic for the behavior. (Like handling OK and Cancel, modifying the view when the user makes some input, and so on.) What I had in mind was creating instances of such classes, sending events to the resulting dialogs and checking that the resulting object state is consistent. But I don't yet have a clear idea on how these tests might exactly look. Markus

Markus Schöpflin <markus.schoepflin <at> comsoft.de> writes:
Hello,
did anybody ever use boost.test to test the UI behavior of classes, like for example instantiating a class implementing a dialog, sending some events to the resulting object, and checking that the object has the expected state.
It would be interresting to create some kind of extension to Boost.Test for GUI testing.
AFAICT this would require to somehow integrate the main event loop of the respective GUI framework with the main loop of boost test, but I'm at a loss how this could be accomplished.
Use DLL version of the Boost.Test and you can implement your own main and invoke Boost.Test runner from it. Gennadiy

Gennadiy Rozental wrote:
Markus Schöpflin <markus.schoepflin <at> comsoft.de> writes:
[...]
AFAICT this would require to somehow integrate the main event loop of the respective GUI framework with the main loop of boost test, but I'm at a loss how this could be accomplished.
Use DLL version of the Boost.Test and you can implement your own main and invoke Boost.Test runner from it.
Thank you, I'll try and see if this gets me anywhere. Markus
participants (3)
-
Gennadiy Rozental
-
Jamie Allsop
-
Markus Schöpflin