mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-23 12:41:50 +01:00
tests: Add G_TEST_OPTION_ISOLATE_DIRS to almost all gdbus tests
This is a spiritual follow-up to commit 8cff531520
, which
added `G_TEST_OPTION_ISOLATE_DIRS` to the `gdbus-connection-flush` test
to avoid its D-Bus cookie lock file from being erroneously deleted by
other tests running in parallel.
The same failure mode could affect any of the other D-Bus tests which
connect to a bus. As an easy fix, enable `G_TEST_OPTION_ISOLATE_DIRS`
for all of them.
The only test it’s not (yet) enabled for is `gdbus-address-get-session`
as that messes around with `XDG_RUNTIME_DIR` to test finding the session
bus. It might be possible to use `G_TEST_OPTION_ISOLATE_DIRS` with it,
but that would take longer than I have right now.
In any case, the more tests (which try to connect to a bus) that this is
enabled for, the lower the chances of spurious test failure due to them
conflicting over shared resources.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
ad755e7489
commit
fd27c8dc6e
@ -209,7 +209,7 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char *argv[])
|
char *argv[])
|
||||||
{
|
{
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
g_test_add_func ("/gdbus/empty-address", test_empty_address);
|
g_test_add_func ("/gdbus/empty-address", test_empty_address);
|
||||||
g_test_add_func ("/gdbus/unsupported-address", test_unsupported_address);
|
g_test_add_func ("/gdbus/unsupported-address", test_unsupported_address);
|
||||||
|
@ -287,7 +287,7 @@ main (int argc,
|
|||||||
|
|
||||||
temp_dbus_keyrings_setup ();
|
temp_dbus_keyrings_setup ();
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
g_test_add_func ("/gdbus/auth/client/EXTERNAL", auth_client_external);
|
g_test_add_func ("/gdbus/auth/client/EXTERNAL", auth_client_external);
|
||||||
g_test_add_func ("/gdbus/auth/client/DBUS_COOKIE_SHA1", auth_client_dbus_cookie_sha1);
|
g_test_add_func ("/gdbus/auth/client/DBUS_COOKIE_SHA1", auth_client_dbus_cookie_sha1);
|
||||||
|
@ -80,7 +80,7 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char *argv[])
|
char *argv[])
|
||||||
{
|
{
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
g_test_dbus_unset ();
|
g_test_dbus_unset ();
|
||||||
|
|
||||||
|
@ -385,7 +385,7 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char *argv[])
|
char *argv[])
|
||||||
{
|
{
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
g_test_add ("/gdbus/close-pending", Fixture, "close",
|
g_test_add ("/gdbus/close-pending", Fixture, "close",
|
||||||
setup, test_many_times, teardown);
|
setup, test_many_times, teardown);
|
||||||
|
@ -114,7 +114,7 @@ main (int argc,
|
|||||||
gint ret;
|
gint ret;
|
||||||
gchar *path;
|
gchar *path;
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
/* all the tests rely on a shared main loop */
|
/* all the tests rely on a shared main loop */
|
||||||
loop = g_main_loop_new (NULL, FALSE);
|
loop = g_main_loop_new (NULL, FALSE);
|
||||||
|
@ -225,7 +225,7 @@ main (int argc,
|
|||||||
{
|
{
|
||||||
gint ret;
|
gint ret;
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
/* all the tests rely on a shared main loop */
|
/* all the tests rely on a shared main loop */
|
||||||
loop = g_main_loop_new (NULL, FALSE);
|
loop = g_main_loop_new (NULL, FALSE);
|
||||||
|
@ -1277,7 +1277,7 @@ main (int argc,
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
/* all the tests rely on a shared main loop */
|
/* all the tests rely on a shared main loop */
|
||||||
loop = g_main_loop_new (NULL, FALSE);
|
loop = g_main_loop_new (NULL, FALSE);
|
||||||
|
@ -260,7 +260,7 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char *argv[])
|
char *argv[])
|
||||||
{
|
{
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
g_test_add_func ("/gdbus/registered-errors", test_registered_errors);
|
g_test_add_func ("/gdbus/registered-errors", test_registered_errors);
|
||||||
g_test_add_func ("/gdbus/unregistered-errors", test_unregistered_errors);
|
g_test_add_func ("/gdbus/unregistered-errors", test_unregistered_errors);
|
||||||
|
@ -201,7 +201,7 @@ main (int argc,
|
|||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
for (i = 0; cases[i].name != NULL; i++)
|
for (i = 0; cases[i].name != NULL; i++)
|
||||||
{
|
{
|
||||||
|
@ -1966,7 +1966,7 @@ main (int argc,
|
|||||||
{
|
{
|
||||||
gint ret;
|
gint ret;
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
/* all the tests rely on a shared main loop */
|
/* all the tests rely on a shared main loop */
|
||||||
loop = g_main_loop_new (NULL, FALSE);
|
loop = g_main_loop_new (NULL, FALSE);
|
||||||
|
@ -307,7 +307,7 @@ main (int argc,
|
|||||||
{
|
{
|
||||||
gint ret;
|
gint ret;
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
/* all the tests rely on a shared main loop */
|
/* all the tests rely on a shared main loop */
|
||||||
loop = g_main_loop_new (NULL, FALSE);
|
loop = g_main_loop_new (NULL, FALSE);
|
||||||
|
@ -217,7 +217,7 @@ main (int argc,
|
|||||||
{
|
{
|
||||||
setlocale (LC_ALL, "C");
|
setlocale (LC_ALL, "C");
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
g_test_add_func ("/gdbus/message/lock", message_lock);
|
g_test_add_func ("/gdbus/message/lock", message_lock);
|
||||||
g_test_add_func ("/gdbus/message/copy", message_copy);
|
g_test_add_func ("/gdbus/message/copy", message_copy);
|
||||||
|
@ -1340,7 +1340,7 @@ main (int argc,
|
|||||||
{
|
{
|
||||||
gint ret;
|
gint ret;
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
g_test_dbus_unset ();
|
g_test_dbus_unset ();
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ main (int argc,
|
|||||||
GDBusNodeInfo *introspection_data = NULL;
|
GDBusNodeInfo *introspection_data = NULL;
|
||||||
gchar *tmpdir = NULL;
|
gchar *tmpdir = NULL;
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
introspection_data = g_dbus_node_info_new_for_xml (test_interface_introspection_xml, NULL);
|
introspection_data = g_dbus_node_info_new_for_xml (test_interface_introspection_xml, NULL);
|
||||||
g_assert (introspection_data != NULL);
|
g_assert (introspection_data != NULL);
|
||||||
|
@ -250,7 +250,7 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char *argv[])
|
char *argv[])
|
||||||
{
|
{
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
g_test_dbus_unset ();
|
g_test_dbus_unset ();
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ main (int argc,
|
|||||||
{
|
{
|
||||||
gint ret;
|
gint ret;
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
/* all the tests rely on a shared main loop */
|
/* all the tests rely on a shared main loop */
|
||||||
loop = g_main_loop_new (NULL, FALSE);
|
loop = g_main_loop_new (NULL, FALSE);
|
||||||
|
@ -260,7 +260,7 @@ main (int argc,
|
|||||||
{
|
{
|
||||||
gint ret;
|
gint ret;
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
/* all the tests rely on a shared main loop */
|
/* all the tests rely on a shared main loop */
|
||||||
loop = g_main_loop_new (NULL, FALSE);
|
loop = g_main_loop_new (NULL, FALSE);
|
||||||
|
@ -1017,7 +1017,7 @@ main (int argc,
|
|||||||
gint ret;
|
gint ret;
|
||||||
GDBusNodeInfo *introspection_data = NULL;
|
GDBusNodeInfo *introspection_data = NULL;
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
introspection_data = g_dbus_node_info_new_for_xml (frob_dbus_interface_xml, NULL);
|
introspection_data = g_dbus_node_info_new_for_xml (frob_dbus_interface_xml, NULL);
|
||||||
g_assert_nonnull (introspection_data);
|
g_assert_nonnull (introspection_data);
|
||||||
|
@ -1624,7 +1624,7 @@ main (int argc,
|
|||||||
g_setenv ("LC_ALL", "C", TRUE);
|
g_setenv ("LC_ALL", "C", TRUE);
|
||||||
setlocale (LC_ALL, "C");
|
setlocale (LC_ALL, "C");
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
g_test_add_func ("/gdbus/message-serialize/basic",
|
g_test_add_func ("/gdbus/message-serialize/basic",
|
||||||
test_message_serialize_basic);
|
test_message_serialize_basic);
|
||||||
|
@ -2736,7 +2736,7 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char *argv[])
|
char *argv[])
|
||||||
{
|
{
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
g_test_add_func ("/gdbus/codegen/annotations", test_annotations);
|
g_test_add_func ("/gdbus/codegen/annotations", test_annotations);
|
||||||
g_test_add_func ("/gdbus/codegen/interface_stability", test_interface_stability);
|
g_test_add_func ("/gdbus/codegen/interface_stability", test_interface_stability);
|
||||||
|
@ -80,7 +80,7 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char *argv[])
|
char *argv[])
|
||||||
{
|
{
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
/* This test simply ensures that we can bring the GTestDBus up and down a hand
|
/* This test simply ensures that we can bring the GTestDBus up and down a hand
|
||||||
* full of times in a row, each time successfully activating the in-tree service
|
* full of times in a row, each time successfully activating the in-tree service
|
||||||
|
@ -677,7 +677,7 @@ main (int argc,
|
|||||||
gint ret;
|
gint ret;
|
||||||
gchar *path;
|
gchar *path;
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
|
||||||
|
|
||||||
session_bus_up ();
|
session_bus_up ();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user