From efa9b75d5d21018b27f593ee65ea562d10d6dc2c Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Thu, 24 May 2018 03:26:36 +0530 Subject: Set WINEPATH when running serialized executables When the exe runner is `wine` or `wine32` or `wine64`, etc. This allows people to run tests with wine. Note that you also have to set WINEPATH to point to your custom prefix(es) if your tests use external dependencies. Closes https://github.com/mesonbuild/meson/issues/3620 --- mesonbuild/scripts/meson_exe.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mesonbuild/scripts') diff --git a/mesonbuild/scripts/meson_exe.py b/mesonbuild/scripts/meson_exe.py index 46d501f..a70acca 100644 --- a/mesonbuild/scripts/meson_exe.py +++ b/mesonbuild/scripts/meson_exe.py @@ -57,6 +57,15 @@ def run_exe(exe): if len(exe.extra_paths) > 0: child_env['PATH'] = (os.pathsep.join(exe.extra_paths + ['']) + child_env['PATH']) + if exe.exe_runner and 'wine' in exe.exe_runner: + wine_paths = ['Z:' + p for p in exe.extra_paths] + wine_path = ';'.join(wine_paths) + # Don't accidentally end with an `;` because that will add the + # current directory and might cause unexpected behaviour + if 'WINEPATH' in child_env: + child_env['WINEPATH'] = wine_path + ';' + child_env['WINEPATH'] + else: + child_env['WINEPATH'] = wine_path p = subprocess.Popen(cmd + exe.cmd_args, env=child_env, cwd=exe.workdir, close_fds=False, -- cgit v1.1