Re: g_test with mainloop integration?



On Fri, 4 Jan 2008, Mikkel Kamstrup Erlandsen wrote:

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.

that's what the fixture functions are for, to take over common builerplate
parts of test functions.

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.

it's not clear to me what exactly you'd like to add to the test
framework (since main loops can easily be created/destroyed in
fixture functions). is there any concrete API to add you have in mind?

Cheers,
Mikkel

---
ciaoTJ


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