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); test_seq_no_string = g_strdup_printf ("%d", test_seq_no);
reftest_flags = META_REFTEST_FLAG_NONE; reftest_flags = META_REFTEST_FLAG_NONE;
subprocess = 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, ref_test_name,
test_seq_no_string, test_seq_no_string,
cursor_mode_to_string (cursor_mode), cursor_mode_to_string (cursor_mode),

View File

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

View File

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

View File

@ -32,7 +32,8 @@ meta_test_screen_cast_record_virtual (void)
g_autoptr (GSubprocess) subprocess = NULL; g_autoptr (GSubprocess) subprocess = NULL;
meta_add_verbose_topic (META_DEBUG_SCREEN_CAST); 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); NULL);
meta_wait_test_process (subprocess); meta_wait_test_process (subprocess);
meta_remove_verbose_topic (META_DEBUG_SCREEN_CAST); meta_remove_verbose_topic (META_DEBUG_SCREEN_CAST);