After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 690543 - Add test coverage for testing in-tree DBus services with GTestDBus
Add test coverage for testing in-tree DBus services with GTestDBus
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
unspecified
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-12-20 06:43 UTC by Tristan Van Berkom
Modified: 2013-03-21 07:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch adding a test for in-tree service activation with GTestDBus (7.15 KB, patch)
2012-12-20 06:43 UTC, Tristan Van Berkom
committed Details | Review
Adding examples to GTestDBus documentation (7.29 KB, patch)
2013-01-15 07:01 UTC, Tristan Van Berkom
none Details | Review
Adding examples to GTestDBus documentation (rev 2) (10.38 KB, patch)
2013-01-16 07:29 UTC, Tristan Van Berkom
committed Details | Review

Description Tristan Van Berkom 2012-12-20 06:43:56 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.
Comment 1 Xavier Claessens 2012-12-20 09:53:54 UTC
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/
Comment 2 David Zeuthen (not reading bugmail) 2012-12-20 15:46:15 UTC
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.
Comment 3 Xavier Claessens 2012-12-21 09:18:19 UTC
I would add examples in the GTestDBus description. But "Migrating to GDBus" could definitely link to GTestDBus.
Comment 4 David Zeuthen (not reading bugmail) 2012-12-21 15:39:38 UTC
(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.
Comment 5 David Zeuthen (not reading bugmail) 2012-12-21 15:41:39 UTC
Review of attachment 231969 [details] [review]:

Looks good to me, thanks for adding this.
Comment 6 Tristan Van Berkom 2013-01-15 06:59:42 UTC
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.
Comment 7 Tristan Van Berkom 2013-01-15 07:01:06 UTC
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.
Comment 8 Tristan Van Berkom 2013-01-16 07:29:11 UTC
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).
Comment 9 Xavier Claessens 2013-01-16 09:17:37 UTC
Looks good to me. Thanks.
Comment 10 Xavier Claessens 2013-03-21 07:17:14 UTC
Reopening, I think it is worth merging attachment #233573 [details] as well.
Comment 11 Tristan Van Berkom 2013-03-21 07:39:36 UTC
I thought I had committed that one :-/

It was sitting there at the tip of my glib checkout, pushed.