In the following example, the test code forks, the forked child
process produces some sample output and exits successfully.
The forking parent process then asserts successful child program
termination and validates child program outputs.
true for the forked child and false for the executing parent process.
Since
2.16
Deprecated
This function is implemented only on Unix platforms, is not always reliable due to problems inherent in fork-without-exec and doesn't set close-on-exec flag on its file descriptors. Use func@GLib.test_trap_subprocess] instead.
Forks the current test program to execute a test case that might not return or that might abort.
If
usec_timeoutis non-0, the forked test case is aborted and considered failing if its run time exceeds it.The forking behavior can be configured with GLib.TestTrapFlags flags.
In the following example, the test code forks, the forked child process produces some sample output and exits successfully. The forking parent process then asserts successful child program termination and validates child program outputs.