GNOME Bugzilla – Bug 690543
Add test coverage for testing in-tree DBus services with GTestDBus
Last modified: 2013-03-21 07:39:36 UTC
Created attachment 231969 [details] [review] Patch adding a test for in-tree service activation with GTestDBus While using GTestDBus to create a properly isolated unit test framework for Evolution Data Server, I encountered problems when running two tests in a row with private/in-tree server activation. While this test does not show any problems with the basic examples provided in GIO, it does prove that the problem is in the server implementations in EDS. Also GIO doesnt show any examples of how to do this or provide any test coverage for in-tree server activation, so I think it's of some value to add this test to GIO, to protect against regressions and to serve as a simple example of how to use GTestDBus for isolated testing of an in-tree service.
Reading your blog post[1], I think you should turn it into GTestDBus doc. I think it's a common use case and it should appear in devhelp :-) Your test is also good to add IMO. [1] http://blogs.gnome.org/tvb/2012/12/20/isolated-unit-testing-of-d-bus-services/
I agree it would be nice to add docs - probably in the "Migrating to GDBus" chapter, this one http://developer.gnome.org/gio/unstable/ch32.html or perhaps its own.
I would add examples in the GTestDBus description. But "Migrating to GDBus" could definitely link to GTestDBus.
(In reply to comment #3) > I would add examples in the GTestDBus description. Right, like we have code-snippets for e.g. GDBusServer and g_bus_{own,watch}_name()? If so, sounds good to me. > But "Migrating to GDBus" > could definitely link to GTestDBus. Cool, yeah, in that case, just a bullet in "Conceptual differences" and "API comparison" makes sense, I guess.
Review of attachment 231969 [details] [review]: Looks good to me, thanks for adding this.
Comment on attachment 231969 [details] [review] Patch adding a test for in-tree service activation with GTestDBus Thanks for committing this while I was out on vacation. Just marking this one committed.
Created attachment 233501 [details] [review] Adding examples to GTestDBus documentation As requested, here is a patch that adds the content of my recent blog post as documentation to GTestDBus.
Created attachment 233573 [details] [review] Adding examples to GTestDBus documentation (rev 2) This is a new version of the documentation patch. This one includes gdbus-test-fixture.c directly in the documentation instead of including code snippets (and adds comments to the fixture test to make it more suitable as an example).
Looks good to me. Thanks.
Reopening, I think it is worth merging attachment #233573 [details] as well.
I thought I had committed that one :-/ It was sitting there at the tip of my glib checkout, pushed.