]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
test: Set PATH or WINEPATH to find dbus-daemon.exe in build-time tests
authorSimon McVittie <smcv@collabora.com>
Wed, 13 Jul 2022 18:02:44 +0000 (19:02 +0100)
committerSimon McVittie <smcv@collabora.com>
Wed, 13 Jul 2022 19:36:13 +0000 (20:36 +0100)
When building for Windows, either natively or cross-compiling and
running tests with Wine, test-autolaunch-win expects to be able to
find the just-built dbus-daemon.exe in the PATH.

Signed-off-by: Simon McVittie <smcv@collabora.com>
test/meson.build

index 00d0cbfa1f9b73ad81d5e8b0c29866de86ea0c67..43ae3e9343786869f7e9b8a3a4eb096f3c1ebb5f 100644 (file)
@@ -61,6 +61,21 @@ if platform_unix
     test_env.set('DBUS_TEST_DBUS_UUIDGEN', dbus_uuidgen.full_path())
 endif
 
+if platform_windows
+    # test-autolaunch-win relies on being able to find the just-built
+    # dbus-daemon in the PATH
+    if build_machine.system().contains('windows')
+        test_env.prepend('PATH', meson.project_build_root() / 'bus')
+    else
+        # Assume we'll use Wine to run tests while cross-compiling
+        test_env.prepend(
+            'WINEPATH',
+            'Z:' + meson.project_build_root() / 'bus',
+            separator: ';',
+        )
+    endif
+endif
+
 # Tests in bus/config-parser.c rely on these specific values for XDG_*
 test_env.set('XDG_DATA_HOME',       meson.current_build_dir() / 'XDG_DATA_HOME')
 test_env.set('XDG_RUNTIME_DIR',     meson.current_build_dir() / 'XDG_RUNTIME_DIR')