gtestutils: Add g_test_trap_subprocess_with_envp() for testing envs

This is a variant of `g_test_trap_subprocess()` which allows the
environment for the child process to be specified. This is quite useful
when you want to test code which reads environment variables, as it’s
not safe to set those after the start of `main()`.

This will be useful within and outwith GLib for testing such code.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #1618
This commit is contained in:
Philip Withnall
2023-11-23 12:08:14 +00:00
parent c7a02280f5
commit 6a6b36bbc7
4 changed files with 81 additions and 6 deletions

View File

@@ -3363,6 +3363,7 @@ g_test_assert_expected_messages
GTestTrapFlags
GTestSubprocessFlags
g_test_trap_subprocess
g_test_trap_subprocess_with_envp
g_test_trap_has_passed
g_test_trap_reached_timeout
g_test_trap_assert_passed