I am trying to test the behavior of a state machine using the Qt test environment. I just don't understand how I should test the Qt SCXML implementation. Of course there is QSignalSpy, but this is only for signals / slops that do not require the start of an event loop. What I really want to do is:
myStateMachine.submitEvent("MyEvent");
I tried QCoreApplication::processEvents(), it sometimes worked, but sometimes it also gets stuck on a call processEvents(). I guess I could start an endless loop. Also googling didn't help, but there should be a way to do it right.
source
share