[PULL 01/19] tests/functional: preserve PYTHONPATH entries

Paolo Bonzini posted 19 patches 1 week, 1 day ago
Only 1 patches received!
[PULL 01/19] tests/functional: preserve PYTHONPATH entries
Posted by Paolo Bonzini 1 week, 1 day ago
From: Alyssa Ross <hi@alyssa.is>

Otherwise, it's not possible to use a packaged qemu.qmp.

Fixes: 1497377857 ("tests/functional: Prepare the meson build system for the functional tests")
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Link: https://lore.kernel.org/r/20260323084739.1013748-1-hi@alyssa.is
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tests/functional/meson.build | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 3b42299e7ce..c158197c4b7 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -76,8 +76,10 @@ foreach speed : ['quick', 'thorough']
     endif
     test_env.set('QEMU_TEST_QEMU_BINARY', test_emulator.full_path())
     test_env.set('MESON_BUILD_ROOT', meson.project_build_root())
-    test_env.set('PYTHONPATH', meson.project_source_root() / 'python:' +
-                               meson.current_source_dir())
+    test_env.prepend('PYTHONPATH',
+                     meson.project_source_root() / 'python',
+                     meson.current_source_dir(),
+                     separator : ':')
 
     # Define the GDB environment variable if gdb is available.
     gdb = get_option('gdb')
@@ -97,8 +99,10 @@ foreach speed : ['quick', 'thorough']
       test_precache_env = environment()
       test_precache_env.set('QEMU_TEST_PRECACHE', meson.current_build_dir() / teststamp)
       test_precache_env.set('MESON_BUILD_ROOT', meson.project_build_root())
-      test_precache_env.set('PYTHONPATH', meson.project_source_root() / 'python:' +
-                                          meson.current_source_dir())
+      test_precache_env.prepend('PYTHONPATH',
+                                meson.project_source_root() / 'python',
+                                meson.current_source_dir(),
+                                separator : ':')
       precache = custom_target('func-precache-' + testname,
                                output: teststamp,
                                command: [python, testpath],
-- 
2.53.0
  • [PULL 01/19] tests/functional: preserve PYTHONPATH entries