tests/test-utils: Pass subprocess flags when launching test executable

Will be used to create stdin/stdout pipes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4210>
This commit is contained in:
Jonas Ådahl 2025-01-10 17:22:21 +01:00
parent 3b1067e783
commit 7b0a65d728
4 changed files with 11 additions and 7 deletions

View File

@ -292,7 +292,8 @@ verify_screen_cast_content (const char *ref_test_name,
test_seq_no_string = g_strdup_printf ("%d", test_seq_no);
reftest_flags = META_REFTEST_FLAG_NONE;
subprocess =
meta_launch_test_executable ("mutter-cursor-tests-screen-cast-client",
meta_launch_test_executable (G_SUBPROCESS_FLAGS_NONE,
"mutter-cursor-tests-screen-cast-client",
ref_test_name,
test_seq_no_string,
cursor_mode_to_string (cursor_mode),

View File

@ -920,8 +920,9 @@ meta_flush_input (MetaContext *context)
}
GSubprocess *
meta_launch_test_executable (const char *name,
const char *argv0,
meta_launch_test_executable (GSubprocessFlags subprocess_flags,
const char *name,
const char *argv0,
...)
{
g_autoptr (GPtrArray) args = NULL;
@ -945,7 +946,7 @@ meta_launch_test_executable (const char *name,
g_ptr_array_add (args, NULL);
va_end (ap);
launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_NONE);
launcher = g_subprocess_launcher_new (subprocess_flags);
g_subprocess_launcher_setenv (launcher,
"XDG_RUNTIME_DIR", getenv ("XDG_RUNTIME_DIR"),
TRUE);

View File

@ -130,8 +130,9 @@ META_EXPORT
void meta_flush_input (MetaContext *context);
META_EXPORT
GSubprocess * meta_launch_test_executable (const char *name,
const char *argv0,
GSubprocess * meta_launch_test_executable (GSubprocessFlags subprocess_flags,
const char *name,
const char *argv0,
...);
META_EXPORT

View File

@ -32,7 +32,8 @@ meta_test_screen_cast_record_virtual (void)
g_autoptr (GSubprocess) subprocess = NULL;
meta_add_verbose_topic (META_DEBUG_SCREEN_CAST);
subprocess = meta_launch_test_executable ("mutter-screen-cast-client",
subprocess = meta_launch_test_executable (G_SUBPROCESS_FLAGS_NONE,
"mutter-screen-cast-client",
NULL);
meta_wait_test_process (subprocess);
meta_remove_verbose_topic (META_DEBUG_SCREEN_CAST);