From 7b0a65d728d2a922252c24462afb89bb543f6e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 10 Jan 2025 17:22:21 +0100 Subject: [PATCH] tests/test-utils: Pass subprocess flags when launching test executable Will be used to create stdin/stdout pipes. Part-of: --- src/tests/cursor-tests.c | 3 ++- src/tests/meta-test-utils.c | 7 ++++--- src/tests/meta-test-utils.h | 5 +++-- src/tests/native-screen-cast.c | 3 ++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/tests/cursor-tests.c b/src/tests/cursor-tests.c index 727ffa966..0c84e876e 100644 --- a/src/tests/cursor-tests.c +++ b/src/tests/cursor-tests.c @@ -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), diff --git a/src/tests/meta-test-utils.c b/src/tests/meta-test-utils.c index 481af944e..8c783183c 100644 --- a/src/tests/meta-test-utils.c +++ b/src/tests/meta-test-utils.c @@ -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); diff --git a/src/tests/meta-test-utils.h b/src/tests/meta-test-utils.h index 3af5c743d..c08f5cbd8 100644 --- a/src/tests/meta-test-utils.h +++ b/src/tests/meta-test-utils.h @@ -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 diff --git a/src/tests/native-screen-cast.c b/src/tests/native-screen-cast.c index 01d4a876f..f405537e0 100644 --- a/src/tests/native-screen-cast.c +++ b/src/tests/native-screen-cast.c @@ -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);