mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-30 13:53:30 +02:00
gtestutils: add g_test_trap_subprocess()
g_test_trap_fork() doesn't work on Windows and is potentially flaky on unix anyway given the fork-but-don't-exec. Replace it with g_test_trap_subprocess(), which re-spawns the same program with arguments telling it to run a specific (otherwise-ignored) test case. Make the existing g_test_trap_fork() unit tests be unix-only (they never passed on Windows anyway), and add a parallel set of g_test_trap_subprocess() tests. Also fix the logic of gtestutils's "-p" argument (which is used by the subprocess tests); previously if you had tests "/foo/bar" and "/foo/bar/baz", and ran the test program with "-p /foo/bar/baz", it would run "/foo/bar" too. Fix that and add tests. https://bugzilla.gnome.org/show_bug.cgi?id=679683
This commit is contained in:
@@ -1097,7 +1097,7 @@ g_assert_warning (const char *log_domain,
|
||||
*
|
||||
* Note that you cannot use this to test g_error() messages, since
|
||||
* g_error() intentionally never returns even if the program doesn't
|
||||
* abort; use g_test_trap_fork() in this case.
|
||||
* abort; use g_test_trap_subprocess() in this case.
|
||||
*
|
||||
* Since: 2.34
|
||||
*/
|
||||
|
Reference in New Issue
Block a user