mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-27 17:52:58 +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:
@@ -2907,6 +2907,7 @@ g_test_perf
|
||||
g_test_verbose
|
||||
g_test_undefined
|
||||
g_test_quiet
|
||||
g_test_subprocess
|
||||
g_test_run
|
||||
GTestFunc
|
||||
g_test_add_func
|
||||
@@ -2934,7 +2935,7 @@ g_test_expect_message
|
||||
g_test_assert_expected_messages
|
||||
|
||||
GTestTrapFlags
|
||||
g_test_trap_fork
|
||||
g_test_trap_subprocess
|
||||
g_test_trap_has_passed
|
||||
g_test_trap_reached_timeout
|
||||
g_test_trap_assert_passed
|
||||
@@ -2943,6 +2944,7 @@ g_test_trap_assert_stdout
|
||||
g_test_trap_assert_stdout_unmatched
|
||||
g_test_trap_assert_stderr
|
||||
g_test_trap_assert_stderr_unmatched
|
||||
g_test_trap_fork
|
||||
|
||||
g_test_rand_bit
|
||||
g_test_rand_int
|
||||
|
Reference in New Issue
Block a user