From: Ralf Habacker Date: Fri, 7 Dec 2018 16:52:58 +0000 (+0100) Subject: Decrease the runtime of test refs under Windows by default X-Git-Tag: dbus-1.13.10~38^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95171f4f1ac2069f24cbcc65ba97d61cf0174aba;p=thirdparty%2Fdbus.git Decrease the runtime of test refs under Windows by default If the environment variable DBUS_TEST_SLOW is not set or is 0 fewer iterations are performed in test-refs enough to demonstrate that it works, rather than seriously trying to reproduce race conditions. This solves the long runtime that Wine 3.x (4 times longer than native Windows 7) or Windows 7 as a VirtualBox 5.22 guest (10 times longer) is to be seen. Fixes #244 --- diff --git a/test/internals/refs.c b/test/internals/refs.c index c0f751288..b2e4bb602 100644 --- a/test/internals/refs.c +++ b/test/internals/refs.c @@ -198,6 +198,9 @@ static void setup (Fixture *f, gconstpointer data) { +#ifdef DBUS_WIN + const char *dbus_test_slow = NULL; +#endif if (!dbus_threads_init_default ()) g_error ("OOM"); @@ -207,17 +210,20 @@ setup (Fixture *f, f->n_threads = N_THREADS; f->n_refs = N_REFS; - // wine sets WINESERVERSOCKET for its child processes automatically - if (g_getenv ("WINESERVERSOCKET") != NULL) +#ifdef DBUS_WIN + dbus_test_slow = g_getenv ("DBUS_TEST_SLOW"); + + if (dbus_test_slow == NULL || atoi (dbus_test_slow) < 1) { /* Our reference-counting is really slow under Wine (it involves - * IPC to wineserver). Do fewer iterations: enough to demonstrate - * that it works, rather than a performance test. + * IPC to wineserver) or Windows 7 guest on VirtualBox (5.22). + * Do fewer iterations: enough to demonstrate that it works, + * rather than seriously trying to reproduce race conditions. */ f->n_threads = 10; f->n_refs = 10; } - +#endif f->loop = _dbus_loop_new (); g_assert (f->loop != NULL);