diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2019-08-27 23:38:05 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-27 23:38:05 +0530 |
commit | 83c010a17aafe59f77f321982ea6790655b97075 (patch) | |
tree | bf7df8f862e44606d81201f3e1c44d100746807d /mesonbuild/mtest.py | |
parent | fe645a0a9e2da230d2c500af1f5b2db5da1e364d (diff) | |
parent | 42c5e4fe2b21a8f70f62e0153d0098b3d186259f (diff) | |
download | meson-83c010a17aafe59f77f321982ea6790655b97075.zip meson-83c010a17aafe59f77f321982ea6790655b97075.tar.gz meson-83c010a17aafe59f77f321982ea6790655b97075.tar.bz2 |
Merge pull request #5756 from thiblahute/wine_shortpaths
wine: Try to get the short paths when generating WINEPATH
Diffstat (limited to 'mesonbuild/mtest.py')
-rw-r--r-- | mesonbuild/mtest.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py index dc5c9d1..e11c8e4 100644 --- a/mesonbuild/mtest.py +++ b/mesonbuild/mtest.py @@ -41,7 +41,7 @@ from . import build from . import environment from . import mlog from .dependencies import ExternalProgram -from .mesonlib import substring_is_in_list, MesonException +from .mesonlib import MesonException, get_wine_shortpath if typing.TYPE_CHECKING: from .backend.backends import TestSerialisation @@ -488,15 +488,15 @@ class SingleTestRunner: if len(self.test.extra_paths) > 0: self.env['PATH'] = os.pathsep.join(self.test.extra_paths + ['']) + self.env['PATH'] - if substring_is_in_list('wine', cmd): - wine_paths = ['Z:' + p for p in self.test.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 self.env: - self.env['WINEPATH'] = wine_path + ';' + self.env['WINEPATH'] - else: - self.env['WINEPATH'] = wine_path + winecmd = [] + for c in cmd: + winecmd.append(c) + if os.path.basename(c).startswith('wine'): + self.env['WINEPATH'] = get_wine_shortpath( + winecmd, + ['Z:' + p for p in self.test.extra_paths] + self.env.get('WINEPATH', '').split(';') + ) + break # If MALLOC_PERTURB_ is not set, or if it is set to an empty value, # (i.e., the test or the environment don't explicitly set it), set |