test: Add InvocationSpy and ValueSpy helper classes
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 4 Oct 2018 16:40:23 +0000 (18:40 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
For test cases testing asynchronous operations that require a running
event loop, it is convenient to have a way to wait until something
happens. Qt provides QSignalSpy to wait for a specific signal while
spinning the event loop. This is not always convenient to use, though.

Provide InvocationSpy and ValueSpy (based on QSignalSpy) that provide
an explicit way of notifying them, without having to connect a signal
first. Unlike QSignalSpy, those classes also time out when not notified
within a given time span.

Put those classes in a new library Quassel::Test::Util, which will
gain more testing-related utils over time.


No differences found