}
/* This is #ifdef G_OS_UNIX anyway, so just use g_test_trap_fork() */
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
if (!g_test_trap_fork (0, 0))
{
/* parent */
g_assert_cmpint (kill (first_child, SIGTERM), ==, 0);
return;
}
+ G_GNUC_END_IGNORE_DEPRECATIONS;
/* second child */
* }
* ]|
*
- * This function is implemented only on Unix platforms.
- *
* Returns: %TRUE for the forked child and %FALSE for the executing parent process.
*
* Since: 2.16
+ *
+ * Deprecated: This function is implemented only on Unix platforms,
+ * and is not always reliable due to problems inherent in
+ * fork-without-exec. Use g_test_trap_subprocess() instead.
*/
gboolean
g_test_trap_fork (guint64 usec_timeout,
G_TEST_TRAP_SILENCE_STDERR = 1 << 8,
G_TEST_TRAP_INHERIT_STDIN = 1 << 9
} GTestTrapFlags;
-GLIB_AVAILABLE_IN_ALL
+
+GLIB_DEPRECATED_IN_2_38_FOR (g_test_trap_subprocess)
gboolean g_test_trap_fork (guint64 usec_timeout,
GTestTrapFlags test_trap_flags);
g_test_maximized_result (5, "bogus-quantity: %ddummies", 5); /* simple API test */
}
+#ifdef G_OS_UNIX
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
/* fork out for a failing test */
static void
test_fork_fail (void)
g_assert (g_test_trap_reached_timeout());
}
+G_GNUC_END_IGNORE_DEPRECATIONS
+#endif /* G_OS_UNIX */
+
static void
test_subprocess_fail_child (void)
{