mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-06 01:16:17 +01:00
d7e368f206
For the reasons given in https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4176#note_2233317, it’s best to not rely on subprocesses when writing tests. Spawning a subprocess can go wrong, getting feedback and assertion data from a subprocess is a pain, and making sure the subprocess is killed properly at the end of the test is hard to get right. For tests where we are trying to mock a D-Bus service, it’s much more reliable to run that service in-process (either in the main thread or in a separate thread). So, do that for the `fake-document-portal` former subprocess in the `dbus-appinfo` test: move it to a worker thread. This speeds the test up, simplifies the build slightly, and should make the test run more reliable. In particular, it provides a pattern for future `fake-*-portal` tests to be built off. This is particularly useful for more complex portals, where data needs to be relayed back from the mock portal service to the unit test to check that the code under test has behaved properly. That’s a pain to do from a subprocess. Delete the `org.freedesktop.portal.Documents.service` file because we no longer need to rely on D-Bus service activation within the test, as we’re setting up the mock service thread explicitly now. Signed-off-by: Philip Withnall <pwithnall@gnome.org> |
||
---|---|---|
.. | ||
meson.build | ||
org.gtk.GDBus.Examples.ObjectManager.service.in | ||
org.gtk.GDBus.FakeService.service.in |