• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From de8672fe0b9f55047fbaee6f425e330cdfc8189f Mon Sep 17 00:00:00 2001
2From: Simon McVittie <smcv@collabora.com>
3Date: Thu, 31 Mar 2022 14:30:43 +0100
4Subject: [PATCH] gtestutils: Add G_TEST_SUBPROCESS_DEFAULT,
5 G_TEST_TRAP_DEFAULT
6
7This makes calls to test subprocesses with default behaviour more
8self-documenting.
9
10Signed-off-by: Simon McVittie <smcv@collabora.com>
11
12Conflict:NA
13Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/de8672fe0b9f55047fbaee6f425e330cdfc8189f
14
15---
16 gio/tests/gapplication.c              |   2 +-
17 gio/tests/gdbus-address-get-session.c |   6 +-
18 gio/tests/gdbus-non-socket.c          |   2 +-
19 gio/tests/gdbus-peer.c                |  10 +--
20 gio/tests/glistmodel.c                |   2 +-
21 gio/tests/gschema-compile.c           |   2 +-
22 gio/tests/gsettings.c                 |  55 +++++++++-----
23 gio/tests/task.c                      |   8 +-
24 gio/tests/tls-bindings.c              |   4 +-
25 gio/tests/win32-appinfo.c             |   6 +-
26 glib/gtestutils.c                     |   3 +-
27 glib/gtestutils.h                     |   3 +
28 glib/tests/array-test.c               |   4 +-
29 glib/tests/convert.c                  |  24 ++++--
30 glib/tests/dataset.c                  |   2 +-
31 glib/tests/error.c                    |   2 +-
32 glib/tests/gvariant.c                 |   2 +-
33 glib/tests/hash.c                     |   3 +-
34 glib/tests/list.c                     |   2 +-
35 glib/tests/logging.c                  |  37 ++++++----
36 glib/tests/mem-overflow.c             |   9 ++-
37 glib/tests/refcount.c                 |   4 +-
38 glib/tests/scannerapi.c               |   2 +-
39 glib/tests/slice.c                    |   4 +-
40 glib/tests/test-printf.c              |  10 ++-
41 glib/tests/testing.c                  | 102 ++++++++++++++++----------
42 glib/tests/thread-pool.c              |   2 +-
43 glib/tests/utils.c                    |   9 ++-
44 glib/tests/win32.c                    |   9 ++-
45 gobject/tests/param.c                 |   5 +-
46 gobject/tests/properties.c            |   4 +-
47 gobject/tests/signals.c               |   4 +-
48 gobject/tests/testing.c               |   3 +-
49 33 files changed, 213 insertions(+), 133 deletions(-)
50
51diff --git a/gio/tests/gapplication.c b/gio/tests/gapplication.c
52index 6f1a27e..b017e43 100644
53--- a/gio/tests/gapplication.c
54+++ b/gio/tests/gapplication.c
55@@ -827,7 +827,7 @@ test_help (void)
56       return;
57     }
58
59-  g_test_trap_subprocess (NULL, 0, 0);
60+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
61   g_test_trap_assert_passed ();
62   g_test_trap_assert_stdout ("*Application options*");
63 }
64diff --git a/gio/tests/gdbus-address-get-session.c b/gio/tests/gdbus-address-get-session.c
65index 72de2c7..4758c8c 100644
66--- a/gio/tests/gdbus-address-get-session.c
67+++ b/gio/tests/gdbus-address-get-session.c
68@@ -142,7 +142,7 @@ test_x11_autolaunch (void)
69       return;
70     }
71
72-  g_test_trap_subprocess (NULL, 0, 0);
73+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
74   g_test_trap_assert_stderr_unmatched ("?*");
75   g_test_trap_assert_stdout ("hello:this=address-is-from-the,mock=dbus-launch\n");
76   g_test_trap_assert_passed ();
77@@ -165,7 +165,7 @@ test_xdg_runtime (void)
78       return;
79     }
80
81-  g_test_trap_subprocess (NULL, 0, 0);
82+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
83   g_test_trap_assert_stderr_unmatched ("?*");
84   g_test_trap_assert_stdout ("unix:path=/tmp/gdbus%2Cunix%2Ctest.*/bus\n");
85   g_test_trap_assert_passed ();
86@@ -201,7 +201,7 @@ test_win32_autolaunch (void)
87       return;
88     }
89
90-  g_test_trap_subprocess (NULL, 0, 0);
91+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
92   /* stderr is not checked: coverage prints warnings there */
93   g_test_trap_assert_stdout ("nonce-tcp:host=localhost,port=*,noncefile=*\\gdbus-nonce-file-*\n");
94   g_test_trap_assert_passed ();
95diff --git a/gio/tests/gdbus-non-socket.c b/gio/tests/gdbus-non-socket.c
96index 7ddb55b..c246aea 100644
97--- a/gio/tests/gdbus-non-socket.c
98+++ b/gio/tests/gdbus-non-socket.c
99@@ -220,7 +220,7 @@ test_non_socket (void)
100
101   /* This is #ifdef G_OS_UNIX anyway, so just use g_test_trap_fork() */
102   G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
103-  if (!g_test_trap_fork (0, 0))
104+  if (!g_test_trap_fork (0, G_TEST_TRAP_DEFAULT))
105     {
106       /* parent */
107       g_object_unref (streams[0]);
108diff --git a/gio/tests/gdbus-peer.c b/gio/tests/gdbus-peer.c
109index 2f2caf7..dff47d4 100644
110--- a/gio/tests/gdbus-peer.c
111+++ b/gio/tests/gdbus-peer.c
112@@ -1164,7 +1164,7 @@ test_peer_invalid_server (void)
113     }
114   else
115     {
116-      g_test_trap_subprocess (NULL, 0, 0);
117+      g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
118       g_test_trap_assert_failed ();
119       g_test_trap_assert_stderr ("*CRITICAL*G_DBUS_SERVER_FLAGS_ALL*");
120     }
121@@ -1211,7 +1211,7 @@ test_peer_invalid_conn_stream_sync (void)
122     }
123   else
124     {
125-      g_test_trap_subprocess (NULL, 0, 0);
126+      g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
127       g_test_trap_assert_failed ();
128       g_test_trap_assert_stderr ("*CRITICAL*G_DBUS_CONNECTION_FLAGS_ALL*");
129     }
130@@ -1257,7 +1257,7 @@ test_peer_invalid_conn_stream_async (void)
131     }
132   else
133     {
134-      g_test_trap_subprocess (NULL, 0, 0);
135+      g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
136       g_test_trap_assert_failed ();
137       g_test_trap_assert_stderr ("*CRITICAL*G_DBUS_CONNECTION_FLAGS_ALL*");
138     }
139@@ -1286,7 +1286,7 @@ test_peer_invalid_conn_addr_sync (void)
140     }
141   else
142     {
143-      g_test_trap_subprocess (NULL, 0, 0);
144+      g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
145       g_test_trap_assert_failed ();
146       g_test_trap_assert_stderr ("*CRITICAL*G_DBUS_CONNECTION_FLAGS_ALL*");
147     }
148@@ -1309,7 +1309,7 @@ test_peer_invalid_conn_addr_async (void)
149     }
150   else
151     {
152-      g_test_trap_subprocess (NULL, 0, 0);
153+      g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
154       g_test_trap_assert_failed ();
155       g_test_trap_assert_stderr ("*CRITICAL*G_DBUS_CONNECTION_FLAGS_ALL*");
156     }
157diff --git a/gio/tests/glistmodel.c b/gio/tests/glistmodel.c
158index e50969e..62986d7 100644
159--- a/gio/tests/glistmodel.c
160+++ b/gio/tests/glistmodel.c
161@@ -62,7 +62,7 @@ test_store_non_gobjects (void)
162       return;
163     }
164
165-  g_test_trap_subprocess (NULL, 0, 0);
166+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
167   g_test_trap_assert_failed ();
168   g_test_trap_assert_stderr ("*WARNING*value * of type 'GType' is invalid or "
169                              "out of range for property 'item-type'*");
170diff --git a/gio/tests/gschema-compile.c b/gio/tests/gschema-compile.c
171index 8dc4985..6a51e42 100644
172--- a/gio/tests/gschema-compile.c
173+++ b/gio/tests/gschema-compile.c
174@@ -38,7 +38,7 @@ test_schema (gpointer data)
175   gchar *child_name;
176
177   child_name = g_strdup_printf ("/gschema/%s%s/subprocess/do_compile", test->name, test->opt ? "/opt" : "");
178-  g_test_trap_subprocess (child_name, 0, 0);
179+  g_test_trap_subprocess (child_name, 0, G_TEST_SUBPROCESS_DEFAULT);
180   g_free (child_name);
181
182   if (test->err)
183diff --git a/gio/tests/gsettings.c b/gio/tests/gsettings.c
184index 35d958e..1956ac5 100644
185--- a/gio/tests/gsettings.c
186+++ b/gio/tests/gsettings.c
187@@ -147,7 +147,7 @@ test_unknown_key (void)
188       g_object_unref (settings);
189       return;
190     }
191-  g_test_trap_subprocess (NULL, 0, 0);
192+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
193   g_test_trap_assert_failed ();
194   g_test_trap_assert_stderr ("*does not contain*");
195 }
196@@ -170,7 +170,7 @@ test_no_schema (void)
197       g_assert_null (settings);
198       return;
199     }
200-  g_test_trap_subprocess (NULL, 0, 0);
201+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
202   g_test_trap_assert_failed ();
203   g_test_trap_assert_stderr ("*Settings schema 'no.such.schema' is not installed*");
204 }
205@@ -220,7 +220,7 @@ test_wrong_path (void)
206       settings = g_settings_new_with_path ("org.gtk.test", "/wrong-path/");
207       return;
208     }
209-  g_test_trap_subprocess (NULL, 0, 0);
210+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
211   g_test_trap_assert_failed ();
212   g_test_trap_assert_stderr ("*but path * specified by schema*");
213 }
214@@ -238,7 +238,7 @@ test_no_path (void)
215       settings = g_settings_new ("org.gtk.test.no-path");
216       return;
217     }
218-  g_test_trap_subprocess (NULL, 0, 0);
219+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
220   g_test_trap_assert_failed ();
221   g_test_trap_assert_stderr ("*attempting to create schema * without a path**");
222 }
223@@ -1507,7 +1507,7 @@ test_typesafe_binding (void)
224       g_object_unref (settings);
225       return;
226     }
227-  g_test_trap_subprocess (NULL, 0, 0);
228+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
229   g_test_trap_assert_failed ();
230   g_test_trap_assert_stderr ("*not compatible*");
231 }
232@@ -1665,12 +1665,14 @@ test_no_read_binding (void)
233 {
234   if (g_test_undefined ())
235     {
236-      g_test_trap_subprocess ("/gsettings/no-read-binding/subprocess/fail", 0, 0);
237+      g_test_trap_subprocess ("/gsettings/no-read-binding/subprocess/fail", 0,
238+                              G_TEST_SUBPROCESS_DEFAULT);
239       g_test_trap_assert_failed ();
240       g_test_trap_assert_stderr ("*property*is not readable*");
241     }
242
243-  g_test_trap_subprocess ("/gsettings/no-read-binding/subprocess/pass", 0, 0);
244+  g_test_trap_subprocess ("/gsettings/no-read-binding/subprocess/pass", 0,
245+                          G_TEST_SUBPROCESS_DEFAULT);
246   g_test_trap_assert_passed ();
247 }
248
249@@ -1708,12 +1710,14 @@ test_no_write_binding (void)
250 {
251   if (g_test_undefined ())
252     {
253-      g_test_trap_subprocess ("/gsettings/no-write-binding/subprocess/fail", 0, 0);
254+      g_test_trap_subprocess ("/gsettings/no-write-binding/subprocess/fail", 0,
255+                              G_TEST_SUBPROCESS_DEFAULT);
256       g_test_trap_assert_failed ();
257       g_test_trap_assert_stderr ("*property*is not writable*");
258     }
259
260-  g_test_trap_subprocess ("/gsettings/no-write-binding/subprocess/pass", 0, 0);
261+  g_test_trap_subprocess ("/gsettings/no-write-binding/subprocess/pass", 0,
262+                          G_TEST_SUBPROCESS_DEFAULT);
263   g_test_trap_assert_passed ();
264 }
265
266@@ -2141,19 +2145,23 @@ test_enums (void)
267
268   if (g_test_undefined () && !backend_set)
269     {
270-      g_test_trap_subprocess ("/gsettings/enums/subprocess/non-enum-key", 0, 0);
271+      g_test_trap_subprocess ("/gsettings/enums/subprocess/non-enum-key", 0,
272+                              G_TEST_SUBPROCESS_DEFAULT);
273       g_test_trap_assert_failed ();
274       g_test_trap_assert_stderr ("*not associated with an enum*");
275
276-      g_test_trap_subprocess ("/gsettings/enums/subprocess/non-enum-value", 0, 0);
277+      g_test_trap_subprocess ("/gsettings/enums/subprocess/non-enum-value", 0,
278+                              G_TEST_SUBPROCESS_DEFAULT);
279       g_test_trap_assert_failed ();
280       g_test_trap_assert_stderr ("*invalid enum value 42*");
281
282-      g_test_trap_subprocess ("/gsettings/enums/subprocess/range", 0, 0);
283+      g_test_trap_subprocess ("/gsettings/enums/subprocess/range", 0,
284+                              G_TEST_SUBPROCESS_DEFAULT);
285       g_test_trap_assert_failed ();
286       g_test_trap_assert_stderr ("*g_settings_set_value*valid range*");
287
288-      g_test_trap_subprocess ("/gsettings/enums/subprocess/non-flags", 0, 0);
289+      g_test_trap_subprocess ("/gsettings/enums/subprocess/non-flags", 0,
290+                              G_TEST_SUBPROCESS_DEFAULT);
291       g_test_trap_assert_failed ();
292       g_test_trap_assert_stderr ("*not associated with a flags*");
293     }
294@@ -2239,19 +2247,23 @@ test_flags (void)
295
296   if (g_test_undefined () && !backend_set)
297     {
298-      g_test_trap_subprocess ("/gsettings/flags/subprocess/non-flags-key", 0, 0);
299+      g_test_trap_subprocess ("/gsettings/flags/subprocess/non-flags-key", 0,
300+                              G_TEST_SUBPROCESS_DEFAULT);
301       g_test_trap_assert_failed ();
302       g_test_trap_assert_stderr ("*not associated with a flags*");
303
304-      g_test_trap_subprocess ("/gsettings/flags/subprocess/non-flags-value", 0, 0);
305+      g_test_trap_subprocess ("/gsettings/flags/subprocess/non-flags-value", 0,
306+                              G_TEST_SUBPROCESS_DEFAULT);
307       g_test_trap_assert_failed ();
308       g_test_trap_assert_stderr ("*invalid flags value 0x00000042*");
309
310-      g_test_trap_subprocess ("/gsettings/flags/subprocess/range", 0, 0);
311+      g_test_trap_subprocess ("/gsettings/flags/subprocess/range", 0,
312+                              G_TEST_SUBPROCESS_DEFAULT);
313       g_test_trap_assert_failed ();
314       g_test_trap_assert_stderr ("*g_settings_set_value*valid range*");
315
316-      g_test_trap_subprocess ("/gsettings/flags/subprocess/non-enum", 0, 0);
317+      g_test_trap_subprocess ("/gsettings/flags/subprocess/non-enum", 0,
318+                              G_TEST_SUBPROCESS_DEFAULT);
319       g_test_trap_assert_failed ();
320       g_test_trap_assert_stderr ("*not associated with an enum*");
321     }
322@@ -2328,11 +2340,13 @@ test_range (void)
323
324   if (g_test_undefined () && !backend_set)
325     {
326-      g_test_trap_subprocess ("/gsettings/range/subprocess/high", 0, 0);
327+      g_test_trap_subprocess ("/gsettings/range/subprocess/high", 0,
328+                              G_TEST_SUBPROCESS_DEFAULT);
329       g_test_trap_assert_failed ();
330       g_test_trap_assert_stderr ("*g_settings_set_value*valid range*");
331
332-      g_test_trap_subprocess ("/gsettings/range/subprocess/low", 0, 0);
333+      g_test_trap_subprocess ("/gsettings/range/subprocess/low", 0,
334+                              G_TEST_SUBPROCESS_DEFAULT);
335       g_test_trap_assert_failed ();
336       g_test_trap_assert_stderr ("*g_settings_set_value*valid range*");
337     }
338@@ -2881,7 +2895,8 @@ test_per_desktop (void)
339
340   if (!g_test_subprocess ())
341     {
342-      g_test_trap_subprocess ("/gsettings/per-desktop/subprocess", 0, 0);
343+      g_test_trap_subprocess ("/gsettings/per-desktop/subprocess", 0,
344+                              G_TEST_SUBPROCESS_DEFAULT);
345       g_test_trap_assert_passed ();
346     }
347
348diff --git a/gio/tests/task.c b/gio/tests/task.c
349index 7ce8438..d9e9148 100644
350--- a/gio/tests/task.c
351+++ b/gio/tests/task.c
352@@ -2303,7 +2303,7 @@ test_return_in_idle_error_first (void)
353       return;
354     }
355
356-  g_test_trap_subprocess (NULL, 0, 0);
357+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
358   g_test_trap_assert_failed ();
359   g_test_trap_assert_stderr ("*CRITICAL*assertion '!task->ever_returned' failed*");
360 }
361@@ -2319,7 +2319,7 @@ test_return_in_idle_value_first (void)
362       return;
363     }
364
365-  g_test_trap_subprocess (NULL, 0, 0);
366+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
367   g_test_trap_assert_failed ();
368   g_test_trap_assert_stderr ("*CRITICAL*assertion '!task->ever_returned' failed*");
369 }
370@@ -2335,7 +2335,7 @@ test_return_error_first (void)
371       return;
372     }
373
374-  g_test_trap_subprocess (NULL, 0, 0);
375+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
376   g_test_trap_assert_failed ();
377   g_test_trap_assert_stderr ("*CRITICAL*assertion '!task->ever_returned' failed*");
378 }
379@@ -2351,7 +2351,7 @@ test_return_value_first (void)
380       return;
381     }
382
383-  g_test_trap_subprocess (NULL, 0, 0);
384+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
385   g_test_trap_assert_failed ();
386   g_test_trap_assert_stderr ("*CRITICAL*assertion '!task->ever_returned' failed*");
387 }
388diff --git a/gio/tests/tls-bindings.c b/gio/tests/tls-bindings.c
389index 681b658..81b3189 100644
390--- a/gio/tests/tls-bindings.c
391+++ b/gio/tests/tls-bindings.c
392@@ -40,7 +40,7 @@ get_tls_channel_binding (void)
393             G_TLS_CHANNEL_BINDING_TLS_UNIQUE, NULL, (GError **)&not_null));
394
395   g_object_unref (tls);
396-  g_test_trap_subprocess (NULL, 0, 0);
397+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
398   g_test_trap_assert_failed ();
399   g_test_trap_assert_stderr ("*GLib-GIO-CRITICAL*");
400 }
401@@ -75,7 +75,7 @@ get_dtls_channel_binding (void)
402             G_TLS_CHANNEL_BINDING_TLS_UNIQUE, NULL, (GError **)&not_null));
403
404   g_object_unref (dtls);
405-  g_test_trap_subprocess (NULL, 0, 0);
406+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
407   g_test_trap_assert_failed ();
408   g_test_trap_assert_stderr ("*GLib-GIO-CRITICAL*");
409 }
410diff --git a/gio/tests/win32-appinfo.c b/gio/tests/win32-appinfo.c
411index fa8aa2a..8402a20 100644
412--- a/gio/tests/win32-appinfo.c
413+++ b/gio/tests/win32-appinfo.c
414@@ -442,10 +442,12 @@ do_fail_on_broken_utf16_2 (void)
415 static void
416 test_fail_on_broken_utf16 (void)
417 {
418-  g_test_trap_subprocess ("/appinfo/subprocess/win32-assert-broken-utf16_1", 0, 0);
419+  g_test_trap_subprocess ("/appinfo/subprocess/win32-assert-broken-utf16_1", 0,
420+                          G_TEST_SUBPROCESS_DEFAULT);
421   g_test_trap_assert_failed ();
422   g_test_trap_assert_stderr ("*GLib-GIO:ERROR:*giowin32-private.c:*:_g_win32_extract_executable: assertion failed: (folded)*");
423-  g_test_trap_subprocess ("/appinfo/subprocess/win32-assert-broken-utf16_2", 0, 0);
424+  g_test_trap_subprocess ("/appinfo/subprocess/win32-assert-broken-utf16_2", 0,
425+                          G_TEST_SUBPROCESS_DEFAULT);
426   g_test_trap_assert_failed ();
427   g_test_trap_assert_stderr ("*GLib-GIO:ERROR:*giowin32-private.c:*:_g_win32_extract_executable: assertion failed: (folded)*");
428 }
429diff --git a/glib/gtestutils.c b/glib/gtestutils.c
430index dca4bad..c9c65e6 100644
431--- a/glib/gtestutils.c
432+++ b/glib/gtestutils.c
433@@ -355,6 +355,7 @@
434
435 /**
436  * GTestSubprocessFlags:
437+ * @G_TEST_SUBPROCESS_DEFAULT: Default behaviour. Since: 2.74
438  * @G_TEST_SUBPROCESS_INHERIT_STDIN: If this flag is given, the child
439  *     process will inherit the parent's stdin. Otherwise, the child's
440  *     stdin is redirected to `/dev/null`.
441@@ -3780,7 +3781,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
442  *       }
443  *
444  *     // Reruns this same test in a subprocess
445- *     g_test_trap_subprocess (NULL, 0, 0);
446+ *     g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
447  *     g_test_trap_assert_failed ();
448  *     g_test_trap_assert_stderr ("*ERROR*too large*");
449  *   }
450diff --git a/glib/gtestutils.h b/glib/gtestutils.h
451index 7dee482..794da05 100644
452--- a/glib/gtestutils.h
453+++ b/glib/gtestutils.h
454@@ -423,6 +423,7 @@ void    g_test_queue_destroy            (GDestroyNotify destroy_func,
455
456 /**
457  * GTestTrapFlags:
458+ * @G_TEST_TRAP_DEFAULT: Default behaviour. Since: 2.74
459  * @G_TEST_TRAP_SILENCE_STDOUT: Redirect stdout of the test child to
460  *     `/dev/null` so it cannot be observed on the console during test
461  *     runs. The actual output is still captured though to allow later
462@@ -443,6 +444,7 @@ void    g_test_queue_destroy            (GDestroyNotify destroy_func,
463  * #GTestSubprocessFlags.
464  */
465 typedef enum {
466+  G_TEST_TRAP_DEFAULT GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0,
467   G_TEST_TRAP_SILENCE_STDOUT    = 1 << 7,
468   G_TEST_TRAP_SILENCE_STDERR    = 1 << 8,
469   G_TEST_TRAP_INHERIT_STDIN     = 1 << 9
470@@ -457,6 +459,7 @@ gboolean g_test_trap_fork               (guint64              usec_timeout,
471 G_GNUC_END_IGNORE_DEPRECATIONS
472
473 typedef enum {
474+  G_TEST_SUBPROCESS_DEFAULT GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0,
475   G_TEST_SUBPROCESS_INHERIT_STDIN  = 1 << 0,
476   G_TEST_SUBPROCESS_INHERIT_STDOUT = 1 << 1,
477   G_TEST_SUBPROCESS_INHERIT_STDERR = 1 << 2
478diff --git a/glib/tests/array-test.c b/glib/tests/array-test.c
479index 284ac08..f2736dd 100644
480--- a/glib/tests/array-test.c
481+++ b/glib/tests/array-test.c
482@@ -859,7 +859,7 @@ array_overflow_append_vals (void)
483     }
484   else
485     {
486-      g_test_trap_subprocess (NULL, 0, 0);
487+      g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
488       g_test_trap_assert_failed ();
489       g_test_trap_assert_stderr ("*adding 4294967295 to array would overflow*");
490     }
491@@ -878,7 +878,7 @@ array_overflow_set_size (void)
492     }
493   else
494     {
495-      g_test_trap_subprocess (NULL, 0, 0);
496+      g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
497       g_test_trap_assert_failed ();
498       g_test_trap_assert_stderr ("*adding 4294967295 to array would overflow*");
499     }
500diff --git a/glib/tests/convert.c b/glib/tests/convert.c
501index de6c8a7..81b8bbe 100644
502--- a/glib/tests/convert.c
503+++ b/glib/tests/convert.c
504@@ -707,9 +707,11 @@ test_convert_embedded_nul (void)
505 static void
506 test_locale_to_utf8_embedded_nul (void)
507 {
508-  g_test_trap_subprocess ("/conversion/locale-to-utf8/embedded-nul/subprocess/utf8", 0, 0);
509+  g_test_trap_subprocess ("/conversion/locale-to-utf8/embedded-nul/subprocess/utf8",
510+                          0, G_TEST_SUBPROCESS_DEFAULT);
511   g_test_trap_assert_passed ();
512-  g_test_trap_subprocess ("/conversion/locale-to-utf8/embedded-nul/subprocess/iconv", 0, 0);
513+  g_test_trap_subprocess ("/conversion/locale-to-utf8/embedded-nul/subprocess/iconv",
514+                          0, G_TEST_SUBPROCESS_DEFAULT);
515   g_test_trap_assert_passed ();
516 }
517
518@@ -758,9 +760,11 @@ test_locale_to_utf8_embedded_nul_iconv (void)
519 static void
520 test_locale_from_utf8_embedded_nul (void)
521 {
522-  g_test_trap_subprocess ("/conversion/locale-from-utf8/embedded-nul/subprocess/utf8", 0, 0);
523+  g_test_trap_subprocess ("/conversion/locale-from-utf8/embedded-nul/subprocess/utf8",
524+                          0, G_TEST_SUBPROCESS_DEFAULT);
525   g_test_trap_assert_passed ();
526-  g_test_trap_subprocess ("/conversion/locale-from-utf8/embedded-nul/subprocess/iconv", 0, 0);
527+  g_test_trap_subprocess ("/conversion/locale-from-utf8/embedded-nul/subprocess/iconv",
528+                          0, G_TEST_SUBPROCESS_DEFAULT);
529   g_test_trap_assert_passed ();
530 }
531
532@@ -811,9 +815,11 @@ test_locale_from_utf8_embedded_nul_iconv (void)
533 static void
534 test_filename_to_utf8_embedded_nul (void)
535 {
536-  g_test_trap_subprocess ("/conversion/filename-to-utf8/embedded-nul/subprocess/utf8", 0, 0);
537+  g_test_trap_subprocess ("/conversion/filename-to-utf8/embedded-nul/subprocess/utf8",
538+                          0, G_TEST_SUBPROCESS_DEFAULT);
539   g_test_trap_assert_passed ();
540-  g_test_trap_subprocess ("/conversion/filename-to-utf8/embedded-nul/subprocess/iconv", 0, 0);
541+  g_test_trap_subprocess ("/conversion/filename-to-utf8/embedded-nul/subprocess/iconv",
542+                          0, G_TEST_SUBPROCESS_DEFAULT);
543   g_test_trap_assert_passed ();
544 }
545
546@@ -868,9 +874,11 @@ test_filename_to_utf8_embedded_nul_iconv (void)
547 static void
548 test_filename_from_utf8_embedded_nul (void)
549 {
550-  g_test_trap_subprocess ("/conversion/filename-from-utf8/embedded-nul/subprocess/utf8", 0, 0);
551+  g_test_trap_subprocess ("/conversion/filename-from-utf8/embedded-nul/subprocess/utf8",
552+                          0, G_TEST_SUBPROCESS_DEFAULT);
553   g_test_trap_assert_passed ();
554-  g_test_trap_subprocess ("/conversion/filename-from-utf8/embedded-nul/subprocess/iconv", 0, 0);
555+  g_test_trap_subprocess ("/conversion/filename-from-utf8/embedded-nul/subprocess/iconv",
556+                          0, G_TEST_SUBPROCESS_DEFAULT);
557   g_test_trap_assert_passed ();
558 }
559
560diff --git a/glib/tests/dataset.c b/glib/tests/dataset.c
561index b02b3e4..3b96b42 100644
562--- a/glib/tests/dataset.c
563+++ b/glib/tests/dataset.c
564@@ -202,7 +202,7 @@ test_datalist_clear (void)
565       return;
566     }
567
568-  g_test_trap_subprocess (NULL, 500000, 0);
569+  g_test_trap_subprocess (NULL, 500000, G_TEST_SUBPROCESS_DEFAULT);
570   g_test_trap_assert_passed ();
571 }
572
573diff --git a/glib/tests/error.c b/glib/tests/error.c
574index 51a0c35..7ea04ea 100644
575--- a/glib/tests/error.c
576+++ b/glib/tests/error.c
577@@ -336,7 +336,7 @@ test_extended_duplicate (void)
578   if (!g_test_subprocess ())
579     {
580       /* Spawn a subprocess and expect it to fail. */
581-      g_test_trap_subprocess (NULL, 0, 0);
582+      g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
583       g_test_trap_assert_failed ();
584       g_test_trap_assert_stderr ("*CRITICAL*Attempted to register an extended error domain for TestError more than once*");
585     }
586diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c
587index 0110f26..89dc914 100644
588--- a/glib/tests/gvariant.c
589+++ b/glib/tests/gvariant.c
590@@ -2934,7 +2934,7 @@ static void
591 do_failed_test (const char *test,
592                 const gchar *pattern)
593 {
594-  g_test_trap_subprocess (test, 1000000, 0);
595+  g_test_trap_subprocess (test, 1000000, G_TEST_SUBPROCESS_DEFAULT);
596   g_test_trap_assert_failed ();
597   g_test_trap_assert_stderr (pattern);
598 }
599diff --git a/glib/tests/hash.c b/glib/tests/hash.c
600index 114b6a2..6d718a7 100644
601--- a/glib/tests/hash.c
602+++ b/glib/tests/hash.c
603@@ -873,7 +873,8 @@ test_recursive_remove_all_subprocess (void)
604 static void
605 test_recursive_remove_all (void)
606 {
607-  g_test_trap_subprocess ("/hash/recursive-remove-all/subprocess", 1000000, 0);
608+  g_test_trap_subprocess ("/hash/recursive-remove-all/subprocess", 1000000,
609+                          G_TEST_SUBPROCESS_DEFAULT);
610   g_test_trap_assert_passed ();
611 }
612
613diff --git a/glib/tests/list.c b/glib/tests/list.c
614index 4efd8b6..20d01db 100644
615--- a/glib/tests/list.c
616+++ b/glib/tests/list.c
617@@ -552,7 +552,7 @@ test_double_free (void)
618       return;
619     }
620
621-  g_test_trap_subprocess (NULL, 0, 0);
622+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
623   g_test_trap_assert_failed ();
624   g_test_trap_assert_stderr ("*corrupted double-linked list detected*");
625 }
626diff --git a/glib/tests/logging.c b/glib/tests/logging.c
627index e9c4e39..a65ba7c 100644
628--- a/glib/tests/logging.c
629+++ b/glib/tests/logging.c
630@@ -200,48 +200,59 @@ test_default_handler_0x400 (void)
631 static void
632 test_default_handler (void)
633 {
634-  g_test_trap_subprocess ("/logging/default-handler/subprocess/error", 0, 0);
635+  g_test_trap_subprocess ("/logging/default-handler/subprocess/error", 0,
636+                          G_TEST_SUBPROCESS_DEFAULT);
637   g_test_trap_assert_failed ();
638   g_test_trap_assert_stderr ("*ERROR*message1*");
639
640-  g_test_trap_subprocess ("/logging/default-handler/subprocess/critical", 0, 0);
641+  g_test_trap_subprocess ("/logging/default-handler/subprocess/critical", 0,
642+                          G_TEST_SUBPROCESS_DEFAULT);
643   g_test_trap_assert_failed ();
644   g_test_trap_assert_stderr ("*CRITICAL*message2*");
645
646-  g_test_trap_subprocess ("/logging/default-handler/subprocess/warning", 0, 0);
647+  g_test_trap_subprocess ("/logging/default-handler/subprocess/warning", 0,
648+                          G_TEST_SUBPROCESS_DEFAULT);
649   g_test_trap_assert_failed ();
650   g_test_trap_assert_stderr ("*WARNING*message3*");
651
652-  g_test_trap_subprocess ("/logging/default-handler/subprocess/message", 0, 0);
653+  g_test_trap_subprocess ("/logging/default-handler/subprocess/message", 0,
654+                          G_TEST_SUBPROCESS_DEFAULT);
655   g_test_trap_assert_passed ();
656   g_test_trap_assert_stderr ("*Message*message4*");
657
658-  g_test_trap_subprocess ("/logging/default-handler/subprocess/info", 0, 0);
659+  g_test_trap_subprocess ("/logging/default-handler/subprocess/info", 0,
660+                          G_TEST_SUBPROCESS_DEFAULT);
661   g_test_trap_assert_passed ();
662   g_test_trap_assert_stdout_unmatched ("*INFO*message5*");
663
664-  g_test_trap_subprocess ("/logging/default-handler/subprocess/bar-info", 0, 0);
665+  g_test_trap_subprocess ("/logging/default-handler/subprocess/bar-info", 0,
666+                          G_TEST_SUBPROCESS_DEFAULT);
667   g_test_trap_assert_passed ();
668   g_test_trap_assert_stdout ("*INFO*message5*");
669
670-  g_test_trap_subprocess ("/logging/default-handler/subprocess/baz-debug", 0, 0);
671+  g_test_trap_subprocess ("/logging/default-handler/subprocess/baz-debug", 0,
672+                          G_TEST_SUBPROCESS_DEFAULT);
673   g_test_trap_assert_passed ();
674   g_test_trap_assert_stdout ("*DEBUG*message6*");
675
676-  g_test_trap_subprocess ("/logging/default-handler/subprocess/debug", 0, 0);
677+  g_test_trap_subprocess ("/logging/default-handler/subprocess/debug", 0,
678+                          G_TEST_SUBPROCESS_DEFAULT);
679   g_test_trap_assert_passed ();
680   g_test_trap_assert_stdout ("*DEBUG*6*6*6*");
681
682-  g_test_trap_subprocess ("/logging/default-handler/subprocess/debug-stderr", 0, 0);
683+  g_test_trap_subprocess ("/logging/default-handler/subprocess/debug-stderr", 0,
684+                          G_TEST_SUBPROCESS_DEFAULT);
685   g_test_trap_assert_passed ();
686   g_test_trap_assert_stdout_unmatched ("DEBUG");
687   g_test_trap_assert_stderr ("*DEBUG*6*6*6*");
688
689-  g_test_trap_subprocess ("/logging/default-handler/subprocess/0x400", 0, 0);
690+  g_test_trap_subprocess ("/logging/default-handler/subprocess/0x400", 0,
691+                          G_TEST_SUBPROCESS_DEFAULT);
692   g_test_trap_assert_passed ();
693   g_test_trap_assert_stdout ("*LOG-0x400*message7*");
694
695-  g_test_trap_subprocess ("/logging/default-handler/subprocess/would-drop", 0, 0);
696+  g_test_trap_subprocess ("/logging/default-handler/subprocess/would-drop", 0,
697+                          G_TEST_SUBPROCESS_DEFAULT);
698   g_test_trap_assert_passed ();
699 }
700
701@@ -254,7 +265,7 @@ test_fatal_log_mask (void)
702       g_log ("bu", G_LOG_LEVEL_INFO, "fatal");
703       return;
704     }
705-  g_test_trap_subprocess (NULL, 0, 0);
706+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
707   g_test_trap_assert_failed ();
708   /* G_LOG_LEVEL_INFO isn't printed by default */
709   g_test_trap_assert_stdout_unmatched ("*fatal*");
710@@ -361,7 +372,7 @@ test_gibberish (void)
711       g_warning ("bla bla \236\237\190");
712       return;
713     }
714-  g_test_trap_subprocess (NULL, 0, 0);
715+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
716   g_test_trap_assert_failed ();
717   g_test_trap_assert_stderr ("*bla bla \\x9e\\x9f\\u000190*");
718 }
719diff --git a/glib/tests/mem-overflow.c b/glib/tests/mem-overflow.c
720index fd92685..66a0056 100644
721--- a/glib/tests/mem-overflow.c
722+++ b/glib/tests/mem-overflow.c
723@@ -139,7 +139,8 @@ mem_overflow (void)
724 #define CHECK_SUBPROCESS_FAIL(name) do { \
725       if (g_test_undefined ()) \
726         { \
727-          g_test_trap_subprocess ("/mem/overflow/subprocess/" #name, 0, 0); \
728+          g_test_trap_subprocess ("/mem/overflow/subprocess/" #name, 0, \
729+                                  G_TEST_SUBPROCESS_DEFAULT); \
730           g_test_trap_assert_failed(); \
731         } \
732     } while (0)
733@@ -147,7 +148,8 @@ mem_overflow (void)
734 #define CHECK_SUBPROCESS_PASS(name) do { \
735       if (g_test_undefined ()) \
736         { \
737-          g_test_trap_subprocess ("/mem/overflow/subprocess/" #name, 0, 0); \
738+          g_test_trap_subprocess ("/mem/overflow/subprocess/" #name, 0, \
739+                                  G_TEST_SUBPROCESS_DEFAULT); \
740           g_test_trap_assert_passed(); \
741         } \
742     } while (0)
743@@ -208,7 +210,8 @@ empty_alloc (void)
744
745   g_assert_cmpint (sizeof (Empty), ==, 0);
746
747-  g_test_trap_subprocess ("/mem/empty-alloc/subprocess", 0, 0);
748+  g_test_trap_subprocess ("/mem/empty-alloc/subprocess", 0,
749+                          G_TEST_SUBPROCESS_DEFAULT);
750   g_test_trap_assert_passed ();
751 }
752 #endif
753diff --git a/glib/tests/refcount.c b/glib/tests/refcount.c
754index e19a2d7..2c527cf 100644
755--- a/glib/tests/refcount.c
756+++ b/glib/tests/refcount.c
757@@ -98,7 +98,7 @@ test_grefcount_saturation (void)
758       exit (0);
759     }
760
761-  g_test_trap_subprocess (NULL, 0, 0);
762+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
763
764 #if defined (G_DISABLE_CHECKS) && defined (__GNUC__)
765   /* With checks disabled we don't get any warning */
766@@ -191,7 +191,7 @@ test_gatomicrefcount_saturation (void)
767       exit (0);
768     }
769
770-  g_test_trap_subprocess (NULL, 0, 0);
771+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
772
773 #if defined (G_DISABLE_CHECKS) && defined (__GNUC__)
774   /* With checks disabled we don't get any warning */
775diff --git a/glib/tests/scannerapi.c b/glib/tests/scannerapi.c
776index 6813184..21b01bf 100644
777--- a/glib/tests/scannerapi.c
778+++ b/glib/tests/scannerapi.c
779@@ -68,7 +68,7 @@ test_scanner_error (ScannerFixture *fix,
780       exit (0);
781     }
782
783-  g_test_trap_subprocess (NULL, 0, 0);
784+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
785   g_test_trap_assert_passed ();
786   g_test_trap_assert_stderr ("*scanner-error-message-test*");
787 }
788diff --git a/glib/tests/slice.c b/glib/tests/slice.c
789index a566280..7cf53b4 100644
790--- a/glib/tests/slice.c
791+++ b/glib/tests/slice.c
792@@ -25,7 +25,7 @@ test_slice_nodebug (void)
793       g_slice_debug_tree_statistics ();
794       return;
795     }
796-  g_test_trap_subprocess (NULL, 1000000, 0);
797+  g_test_trap_subprocess (NULL, 1000000, G_TEST_SUBPROCESS_DEFAULT);
798   g_test_trap_assert_passed ();
799   g_test_trap_assert_stderr ("*GSlice: MemChecker: root=NULL*");
800
801@@ -53,7 +53,7 @@ test_slice_debug (void)
802       g_slice_debug_tree_statistics ();
803       return;
804     }
805-  g_test_trap_subprocess (NULL, 1000000, 0);
806+  g_test_trap_subprocess (NULL, 1000000, G_TEST_SUBPROCESS_DEFAULT);
807   g_test_trap_assert_passed ();
808   g_test_trap_assert_stderr ("*GSlice: MemChecker: * trunks, * branches, * old branches*");
809
810diff --git a/glib/tests/test-printf.c b/glib/tests/test-printf.c
811index 6eadf1e..9aca97f 100644
812--- a/glib/tests/test-printf.c
813+++ b/glib/tests/test-printf.c
814@@ -639,7 +639,7 @@ test_positional_params2 (void)
815       g_assert_cmpint (res, ==, 7);
816       return;
817     }
818-  g_test_trap_subprocess (NULL, 0, 0);
819+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
820   g_test_trap_assert_passed ();
821   g_test_trap_assert_stdout ("a b\n   ab\nabcabc\n");
822 }
823@@ -674,7 +674,7 @@ test_percent2 (void)
824       g_assert_cmpint (res, ==, 1);
825       return;
826     }
827-  g_test_trap_subprocess (NULL, 0, 0);
828+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
829   g_test_trap_assert_passed ();
830   g_test_trap_assert_stdout ("*%*");
831 }
832@@ -858,13 +858,15 @@ _Pragma ("GCC diagnostic pop")
833 static void
834 test_64bit2 (void)
835 {
836-  g_test_trap_subprocess ("/printf/test-64bit/subprocess/base", 0, 0);
837+  g_test_trap_subprocess ("/printf/test-64bit/subprocess/base", 0,
838+                          G_TEST_SUBPROCESS_DEFAULT);
839   g_test_trap_assert_passed ();
840   g_test_trap_assert_stdout ("123456\n-123456\n123456\n"
841                              "361100\n0361100\n1e240\n"
842                              "0x1e240\n1E240\n");
843 #ifdef G_OS_WIN32
844-  g_test_trap_subprocess ("/printf/test-64bit/subprocess/win32", 0, 0);
845+  g_test_trap_subprocess ("/printf/test-64bit/subprocess/win32", 0,
846+                          G_TEST_SUBPROCESS_DEFAULT);
847   g_test_trap_assert_passed ();
848   g_test_trap_assert_stdout ("123456\n-123456\n123456\n"
849                              "361100\n0361100\n1e240\n"
850diff --git a/glib/tests/testing.c b/glib/tests/testing.c
851index accd5db..60fdb4c 100644
852--- a/glib/tests/testing.c
853+++ b/glib/tests/testing.c
854@@ -208,56 +208,69 @@ test_assertions (void)
855   g_variant_unref (v2);
856   g_variant_unref (v1);
857
858-  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpvariant_types", 0, 0);
859+  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpvariant_types", 0,
860+                          G_TEST_SUBPROCESS_DEFAULT);
861   g_test_trap_assert_failed ();
862   g_test_trap_assert_stderr ("*assertion failed*");
863
864-  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpvariant_values", 0, 0);
865+  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpvariant_values", 0,
866+                          G_TEST_SUBPROCESS_DEFAULT);
867   g_test_trap_assert_failed ();
868   g_test_trap_assert_stderr ("*assertion failed*");
869
870-  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstr", 0, 0);
871+  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstr", 0,
872+                          G_TEST_SUBPROCESS_DEFAULT);
873   g_test_trap_assert_failed ();
874   g_test_trap_assert_stderr ("*assertion failed*");
875
876-  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstrv_null1", 0, 0);
877+  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstrv_null1", 0,
878+                          G_TEST_SUBPROCESS_DEFAULT);
879   g_test_trap_assert_failed ();
880   g_test_trap_assert_stderr ("*assertion failed*");
881
882-  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstrv_null2", 0, 0);
883+  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstrv_null2", 0,
884+                          G_TEST_SUBPROCESS_DEFAULT);
885   g_test_trap_assert_failed ();
886   g_test_trap_assert_stderr ("*assertion failed*");
887
888-  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstrv_length", 0, 0);
889+  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstrv_length", 0,
890+                          G_TEST_SUBPROCESS_DEFAULT);
891   g_test_trap_assert_failed ();
892   g_test_trap_assert_stderr ("*assertion failed*");
893
894-  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstrv_values", 0, 0);
895+  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstrv_values", 0,
896+                          G_TEST_SUBPROCESS_DEFAULT);
897   g_test_trap_assert_failed ();
898   g_test_trap_assert_stderr ("*assertion failed*");
899
900-  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpint", 0, 0);
901+  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpint", 0,
902+                          G_TEST_SUBPROCESS_DEFAULT);
903   g_test_trap_assert_failed ();
904   g_test_trap_assert_stderr ("*assertion failed*");
905
906-  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpmem_len", 0, 0);
907+  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpmem_len", 0,
908+                          G_TEST_SUBPROCESS_DEFAULT);
909   g_test_trap_assert_failed ();
910   g_test_trap_assert_stderr ("*assertion failed*len*");
911
912-  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpmem_data", 0, 0);
913+  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpmem_data", 0,
914+                          G_TEST_SUBPROCESS_DEFAULT);
915   g_test_trap_assert_failed ();
916   g_test_trap_assert_stderr ("*assertion failed*");
917   g_test_trap_assert_stderr_unmatched ("*assertion failed*len*");
918
919-  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpmem_null", 0, 0);
920+  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpmem_null", 0,
921+                          G_TEST_SUBPROCESS_DEFAULT);
922   g_test_trap_assert_failed ();
923   g_test_trap_assert_stderr ("*assertion failed*NULL*");
924
925-  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpfloat_epsilon", 0, 0);
926+  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpfloat_epsilon", 0,
927+                          G_TEST_SUBPROCESS_DEFAULT);
928   g_test_trap_assert_failed ();
929   g_test_trap_assert_stderr ("*assertion failed*");
930
931-  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_no_errno", 0, 0);
932+  g_test_trap_subprocess ("/misc/assertions/subprocess/bad_no_errno", 0,
933+                          G_TEST_SUBPROCESS_DEFAULT);
934   g_test_trap_assert_failed ();
935   g_test_trap_assert_stderr ("*assertion failed*");
936 }
937@@ -312,7 +325,7 @@ static void
938 test_fork_timeout (void)
939 {
940   /* allow child to run for only a fraction of a second */
941-  if (g_test_trap_fork (0.11 * 1000000, 0))
942+  if (g_test_trap_fork (0.11 * 1000000, G_TEST_TRAP_DEFAULT))
943     {
944       /* loop and sleep forever */
945       while (TRUE)
946@@ -334,7 +347,7 @@ test_subprocess_fail (void)
947       return;
948     }
949
950-  g_test_trap_subprocess (NULL, 0, 0);
951+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
952   g_test_trap_assert_failed ();
953   g_test_trap_assert_stderr ("*ERROR*test_subprocess_fail*should not be reached*");
954 }
955@@ -344,11 +357,12 @@ test_subprocess_no_such_test (void)
956 {
957   if (g_test_subprocess ())
958     {
959-      g_test_trap_subprocess ("/trap_subprocess/this-test-does-not-exist", 0, 0);
960+      g_test_trap_subprocess ("/trap_subprocess/this-test-does-not-exist", 0,
961+                              G_TEST_SUBPROCESS_DEFAULT);
962       g_assert_not_reached ();
963       return;
964     }
965-  g_test_trap_subprocess (NULL, 0, 0);
966+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
967   g_test_trap_assert_failed ();
968   g_test_trap_assert_stderr ("*test does not exist*");
969   g_test_trap_assert_stderr_unmatched ("*should not be reached*");
970@@ -363,7 +377,7 @@ test_subprocess_patterns (void)
971       g_printerr ("some stderr text: semagic43\n");
972       exit (0);
973     }
974-  g_test_trap_subprocess (NULL, 0,  0);
975+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
976   g_test_trap_assert_passed ();
977   g_test_trap_assert_stdout ("*somagic17*");
978   g_test_trap_assert_stderr ("*semagic43*");
979@@ -380,7 +394,7 @@ test_subprocess_timeout (void)
980       return;
981     }
982   /* allow child to run for only a fraction of a second */
983-  g_test_trap_subprocess (NULL, 0.11 * 1000000, 0);
984+  g_test_trap_subprocess (NULL, 0.11 * 1000000, G_TEST_SUBPROCESS_DEFAULT);
985   g_test_trap_assert_failed ();
986   g_assert_true (g_test_trap_reached_timeout ());
987 }
988@@ -508,16 +522,19 @@ test_fatal_log_handler_critical_fail (void)
989 static void
990 test_fatal_log_handler (void)
991 {
992-  g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/critical-pass", 0, 0);
993+  g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/critical-pass", 0,
994+                          G_TEST_SUBPROCESS_DEFAULT);
995   g_test_trap_assert_passed ();
996   g_test_trap_assert_stderr ("*CRITICAL*g_str_has_prefix*");
997   g_test_trap_assert_stderr ("*CRITICAL*Test passing*");
998
999-  g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/error-fail", 0, 0);
1000+  g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/error-fail", 0,
1001+                          G_TEST_SUBPROCESS_DEFAULT);
1002   g_test_trap_assert_failed ();
1003   g_test_trap_assert_stderr ("*ERROR*Test failing*");
1004
1005-  g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/critical-fail", 0, 0);
1006+  g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/critical-fail", 0,
1007+                          G_TEST_SUBPROCESS_DEFAULT);
1008   g_test_trap_assert_failed ();
1009   g_test_trap_assert_stderr ("*CRITICAL*g_str_has_prefix*");
1010   g_test_trap_assert_stderr_unmatched ("*CRITICAL*Test passing*");
1011@@ -612,34 +629,41 @@ test_expected_messages_unexpected_extra_warning (void)
1012 static void
1013 test_expected_messages (void)
1014 {
1015-  g_test_trap_subprocess ("/misc/expected-messages/subprocess/warning", 0, 0);
1016+  g_test_trap_subprocess ("/misc/expected-messages/subprocess/warning", 0,
1017+                          G_TEST_SUBPROCESS_DEFAULT);
1018   g_test_trap_assert_failed ();
1019   g_test_trap_assert_stderr ("*This is a * warning*");
1020   g_test_trap_assert_stderr_unmatched ("*should not be reached*");
1021
1022-  g_test_trap_subprocess ("/misc/expected-messages/subprocess/expect-warning", 0, 0);
1023+  g_test_trap_subprocess ("/misc/expected-messages/subprocess/expect-warning", 0,
1024+                          G_TEST_SUBPROCESS_DEFAULT);
1025   g_test_trap_assert_failed ();
1026   g_test_trap_assert_stderr_unmatched ("*This is a * warning*");
1027   g_test_trap_assert_stderr ("*should not be reached*");
1028
1029-  g_test_trap_subprocess ("/misc/expected-messages/subprocess/wrong-warning", 0, 0);
1030+  g_test_trap_subprocess ("/misc/expected-messages/subprocess/wrong-warning", 0,
1031+                          G_TEST_SUBPROCESS_DEFAULT);
1032   g_test_trap_assert_failed ();
1033   g_test_trap_assert_stderr_unmatched ("*should not be reached*");
1034   g_test_trap_assert_stderr ("*GLib-CRITICAL*Did not see expected message testing-CRITICAL*should not be *WARNING*This is a * warning*");
1035
1036-  g_test_trap_subprocess ("/misc/expected-messages/subprocess/expected", 0, 0);
1037+  g_test_trap_subprocess ("/misc/expected-messages/subprocess/expected", 0,
1038+                          G_TEST_SUBPROCESS_DEFAULT);
1039   g_test_trap_assert_passed ();
1040   g_test_trap_assert_stderr ("");
1041
1042-  g_test_trap_subprocess ("/misc/expected-messages/subprocess/null-domain", 0, 0);
1043+  g_test_trap_subprocess ("/misc/expected-messages/subprocess/null-domain", 0,
1044+                          G_TEST_SUBPROCESS_DEFAULT);
1045   g_test_trap_assert_passed ();
1046   g_test_trap_assert_stderr ("");
1047
1048-  g_test_trap_subprocess ("/misc/expected-messages/subprocess/extra-warning", 0, 0);
1049+  g_test_trap_subprocess ("/misc/expected-messages/subprocess/extra-warning", 0,
1050+                          G_TEST_SUBPROCESS_DEFAULT);
1051   g_test_trap_assert_passed ();
1052   g_test_trap_assert_stderr ("");
1053
1054-  g_test_trap_subprocess ("/misc/expected-messages/subprocess/unexpected-extra-warning", 0, 0);
1055+  g_test_trap_subprocess ("/misc/expected-messages/subprocess/unexpected-extra-warning", 0,
1056+                          G_TEST_SUBPROCESS_DEFAULT);
1057   g_test_trap_assert_failed ();
1058   g_test_trap_assert_stderr ("*GLib:ERROR*Did not see expected message testing-CRITICAL*nope*");
1059 }
1060@@ -718,7 +742,8 @@ test_dash_p_child_sub_child (void)
1061 static void
1062 test_dash_p (void)
1063 {
1064-  g_test_trap_subprocess ("/misc/dash-p/subprocess/hidden", 0, 0);
1065+  g_test_trap_subprocess ("/misc/dash-p/subprocess/hidden", 0,
1066+                          G_TEST_SUBPROCESS_DEFAULT);
1067   g_test_trap_assert_passed ();
1068   g_test_trap_assert_stdout ("*Test /misc/dash-p/subprocess/hidden ran*");
1069   g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden/sub ran*");
1070@@ -726,7 +751,8 @@ test_dash_p (void)
1071   g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden/sub/subprocess ran*");
1072   g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child*");
1073
1074-  g_test_trap_subprocess ("/misc/dash-p/subprocess/hidden/sub", 0, 0);
1075+  g_test_trap_subprocess ("/misc/dash-p/subprocess/hidden/sub", 0,
1076+                          G_TEST_SUBPROCESS_DEFAULT);
1077   g_test_trap_assert_passed ();
1078   g_test_trap_assert_stdout ("*Test /misc/dash-p/subprocess/hidden/sub ran*");
1079   g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden ran*");
1080@@ -734,7 +760,8 @@ test_dash_p (void)
1081   g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden/subprocess ran*");
1082   g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child*");
1083
1084-  g_test_trap_subprocess ("/misc/dash-p/child", 0, 0);
1085+  g_test_trap_subprocess ("/misc/dash-p/child", 0,
1086+                          G_TEST_SUBPROCESS_DEFAULT);
1087   g_test_trap_assert_passed ();
1088   g_test_trap_assert_stdout ("*Test /misc/dash-p/child ran*");
1089   g_test_trap_assert_stdout ("*Test /misc/dash-p/child/sub ran*");
1090@@ -742,7 +769,8 @@ test_dash_p (void)
1091   g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child/subprocess ran*");
1092   g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden*");
1093
1094-  g_test_trap_subprocess ("/misc/dash-p/child/sub", 0, 0);
1095+  g_test_trap_subprocess ("/misc/dash-p/child/sub", 0,
1096+                          G_TEST_SUBPROCESS_DEFAULT);
1097   g_test_trap_assert_passed ();
1098   g_test_trap_assert_stdout ("*Test /misc/dash-p/child/sub ran*");
1099   g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child ran*");
1100@@ -761,7 +789,7 @@ test_nonfatal (void)
1101       g_print ("The End\n");
1102       return;
1103     }
1104-  g_test_trap_subprocess (NULL, 0, 0);
1105+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
1106   g_test_trap_assert_failed ();
1107   g_test_trap_assert_stderr ("*assertion failed*4 == 5*");
1108   g_test_trap_assert_stdout ("*The End*");
1109@@ -800,7 +828,7 @@ test_fail (void)
1110       subprocess_fail ();
1111       return;
1112     }
1113-  g_test_trap_subprocess (NULL, 0, 0);
1114+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
1115   g_test_trap_assert_failed ();
1116 }
1117
1118@@ -822,7 +850,7 @@ test_incomplete (void)
1119       subprocess_incomplete ();
1120       return;
1121     }
1122-  g_test_trap_subprocess (NULL, 0, 0);
1123+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
1124   /* An incomplete test represents functionality that is known not to be
1125    * implemented yet (an expected failure), so it does not cause test
1126    * failure; but it does count as the test having been skipped, which
1127@@ -839,7 +867,7 @@ test_subprocess_timed_out (void)
1128       g_usleep (1000000);
1129       return;
1130     }
1131-  g_test_trap_subprocess (NULL, 50000, 0);
1132+  g_test_trap_subprocess (NULL, 50000, G_TEST_SUBPROCESS_DEFAULT);
1133   g_assert_true (g_test_trap_reached_timeout ());
1134 }
1135
1136diff --git a/glib/tests/thread-pool.c b/glib/tests/thread-pool.c
1137index 5c70815..23ee27e 100644
1138--- a/glib/tests/thread-pool.c
1139+++ b/glib/tests/thread-pool.c
1140@@ -108,7 +108,7 @@ test_create_first_pool (gconstpointer shared_first)
1141
1142   if (!g_test_subprocess ())
1143     {
1144-      g_test_trap_subprocess (NULL, 0, 0);
1145+      g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
1146       g_test_trap_assert_passed ();
1147       return;
1148     }
1149diff --git a/glib/tests/utils.c b/glib/tests/utils.c
1150index 11fed55..dcdc5a6 100644
1151--- a/glib/tests/utils.c
1152+++ b/glib/tests/utils.c
1153@@ -523,7 +523,7 @@ test_debug (void)
1154       g_assert_cmpint (res, ==, 0);
1155       return;
1156     }
1157-  g_test_trap_subprocess (NULL, 0, 0);
1158+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
1159   g_test_trap_assert_passed ();
1160   g_test_trap_assert_stderr ("*Supported debug values: key1 key2 key3 all help*");
1161 }
1162@@ -553,7 +553,7 @@ test_codeset2 (void)
1163       g_assert_cmpstr (c, ==, "UTF-8");
1164       return;
1165     }
1166-  g_test_trap_subprocess (NULL, 0, 0);
1167+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
1168   g_test_trap_assert_passed ();
1169 }
1170
1171@@ -957,7 +957,8 @@ test_aligned_mem (void)
1172       if (g_test_undefined ()) \
1173         { \
1174           g_test_message (msg); \
1175-          g_test_trap_subprocess ("/utils/aligned-mem/subprocess/" #name, 0, 0); \
1176+          g_test_trap_subprocess ("/utils/aligned-mem/subprocess/" #name, 0, \
1177+                                  G_TEST_SUBPROCESS_DEFAULT); \
1178           g_test_trap_assert_failed (); \
1179         } \
1180     } while (0)
1181@@ -1025,7 +1026,7 @@ test_atexit (void)
1182       g_atexit (atexit_func);
1183       return;
1184     }
1185-  g_test_trap_subprocess (NULL, 0, 0);
1186+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
1187   g_test_trap_assert_passed ();
1188   g_test_trap_assert_stdout ("*atexit called*");
1189 }
1190diff --git a/glib/tests/win32.c b/glib/tests/win32.c
1191index 1219973..3181657 100644
1192--- a/glib/tests/win32.c
1193+++ b/glib/tests/win32.c
1194@@ -99,7 +99,8 @@ test_veh_crash_access_violation (void)
1195 {
1196   g_unsetenv ("G_DEBUGGER");
1197   /* Run a test that crashes */
1198-  g_test_trap_subprocess ("/win32/subprocess/access_violation", 0, 0);
1199+  g_test_trap_subprocess ("/win32/subprocess/access_violation", 0,
1200+                          G_TEST_SUBPROCESS_DEFAULT);
1201   g_test_trap_assert_failed ();
1202 }
1203
1204@@ -108,7 +109,8 @@ test_veh_crash_illegal_instruction (void)
1205 {
1206   g_unsetenv ("G_DEBUGGER");
1207   /* Run a test that crashes */
1208-  g_test_trap_subprocess ("/win32/subprocess/illegal_instruction", 0, 0);
1209+  g_test_trap_subprocess ("/win32/subprocess/illegal_instruction", 0,
1210+                          G_TEST_SUBPROCESS_DEFAULT);
1211   g_test_trap_assert_failed ();
1212 }
1213
1214@@ -125,7 +127,8 @@ test_veh_debug (void)
1215   g_setenv ("G_DEBUGGER_OLD_CONSOLE", "1", TRUE);
1216   g_free (command);
1217   /* Run a test that crashes and runs a debugger */
1218-  g_test_trap_subprocess ("/win32/subprocess/debuggee", 0, 0);
1219+  g_test_trap_subprocess ("/win32/subprocess/debuggee", 0,
1220+                          G_TEST_SUBPROCESS_DEFAULT);
1221   g_test_trap_assert_failed ();
1222   g_test_trap_assert_stderr ("Debugger invoked, attaching to*");
1223 }
1224diff --git a/gobject/tests/param.c b/gobject/tests/param.c
1225index 692f07d..69401ba 100644
1226--- a/gobject/tests/param.c
1227+++ b/gobject/tests/param.c
1228@@ -470,7 +470,7 @@ test_param_invalid_name (gconstpointer test_data)
1229       return;
1230     }
1231
1232-  g_test_trap_subprocess (NULL, 0, 0);
1233+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
1234   g_test_trap_assert_failed ();
1235   g_test_trap_assert_stderr ("*CRITICAL*g_param_spec_is_valid_name (name)*");
1236 }
1237@@ -1115,7 +1115,8 @@ test_param_implement (void)
1238             test_path = g_strdup_printf ("/param/implement/subprocess/%d-%d-%d-%d",
1239                                          change_this_flag, change_this_type,
1240                                          use_this_flag, use_this_type);
1241-            g_test_trap_subprocess (test_path, G_TIME_SPAN_SECOND, 0);
1242+            g_test_trap_subprocess (test_path, G_TIME_SPAN_SECOND,
1243+                                    G_TEST_SUBPROCESS_DEFAULT);
1244             g_free (test_path);
1245
1246             /* We want to ensure that any flags mismatch problems are reported first. */
1247diff --git a/gobject/tests/properties.c b/gobject/tests/properties.c
1248index 3695ee1..1760030 100644
1249--- a/gobject/tests/properties.c
1250+++ b/gobject/tests/properties.c
1251@@ -457,7 +457,7 @@ properties_testv_with_invalid_property_type (void)
1252
1253       g_object_unref (test_obj);
1254     }
1255-  g_test_trap_subprocess (NULL, 0, 0);
1256+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
1257   g_test_trap_assert_failed ();
1258   g_test_trap_assert_stderr ("*WARNING*foo*gint*gchararray*");
1259 }
1260@@ -495,7 +495,7 @@ properties_testv_with_invalid_property_names (void)
1261       g_object_unref (test_obj);
1262     }
1263
1264-  g_test_trap_subprocess (NULL, 0, 0);
1265+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
1266   g_test_trap_assert_failed ();
1267   g_test_trap_assert_stderr ("*CRITICAL*g_object_new_is_valid_property*boo*");
1268 }
1269diff --git a/gobject/tests/signals.c b/gobject/tests/signals.c
1270index ea9a778..8ae3c33 100644
1271--- a/gobject/tests/signals.c
1272+++ b/gobject/tests/signals.c
1273@@ -1638,7 +1638,7 @@ test_lookup_invalid (void)
1274       return;
1275     }
1276
1277-  g_test_trap_subprocess (NULL, 0, 0);
1278+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
1279   g_test_trap_assert_failed ();
1280   g_test_trap_assert_stderr ("*WARNING*unable to look up invalid signal name*");
1281 }
1282@@ -1755,7 +1755,7 @@ test_signals_invalid_name (gconstpointer test_data)
1283       return;
1284     }
1285
1286-  g_test_trap_subprocess (NULL, 0, 0);
1287+  g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
1288   g_test_trap_assert_failed ();
1289   g_test_trap_assert_stderr ("*CRITICAL*g_signal_is_valid_name (signal_name)*");
1290 }
1291diff --git a/gobject/tests/testing.c b/gobject/tests/testing.c
1292index 5c7e663..929ed07 100644
1293--- a/gobject/tests/testing.c
1294+++ b/gobject/tests/testing.c
1295@@ -52,7 +52,8 @@ test_assert_finalize_object (void)
1296
1297   g_assert_finalize_object (obj);
1298
1299-  g_test_trap_subprocess ("/assert/finalize_object/subprocess/bad", 0, 0);
1300+  g_test_trap_subprocess ("/assert/finalize_object/subprocess/bad", 0,
1301+                          G_TEST_SUBPROCESS_DEFAULT);
1302   g_test_trap_assert_failed ();
1303   g_test_trap_assert_stderr ("*g_assert_finalize_object:*'weak_pointer' should be NULL*");
1304 }
1305--
13062.33.0
1307
1308