g_test with mainloop integration?



Hi,

I am playing around with using the new glib testing utilities for
xesam-glib and I am wondering if there is any smart way to integrate
tests with a GMainLoop.

The situation is that I need to test a bunch of async dbus
communications and for that I need a running GMainLoop. For now I have
a mainloop instantiated in my fixture and then start and exit the loop
in each test function. It seems a bit awkward to do it like this
because it introduces some boilerplatish code in each test case.

So my question: Is there a Smart (TM) way to do this or can we add
something to gtestutils to make this easy peasy? I suspect that it
might not be that uncommon since many apps/libs revolve around a
GMainLoop.

Cheers,
Mikkel


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]