diff options
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/run_unittests.py b/run_unittests.py index b034773..d8c3a1c 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -44,6 +44,7 @@ from distutils.dir_util import copy_tree import mesonbuild.mlog import mesonbuild.depfile import mesonbuild.compilers +import mesonbuild.envconfig import mesonbuild.environment import mesonbuild.mesonlib import mesonbuild.coredata @@ -4663,7 +4664,8 @@ class WindowsTests(BasePlatformTests): def _check_ld(self, name: str, lang: str, expected: str) -> None: if not shutil.which(name): raise unittest.SkipTest('Could not find {}.'.format(name)) - with mock.patch.dict(os.environ, {'LD': name}): + envvar = mesonbuild.envconfig.BinaryTable.evarMap['{}ld'.format(lang)] + with mock.patch.dict(os.environ, {envvar: name}): env = get_fake_env() try: comp = getattr(env, 'detect_{}_compiler'.format(lang))(MachineChoice.HOST) @@ -5943,7 +5945,8 @@ c = ['{0}'] raise unittest.SkipTest('Solaris currently cannot override the linker.') if not shutil.which(check): raise unittest.SkipTest('Could not find {}.'.format(check)) - with mock.patch.dict(os.environ, {'LD': name}): + envvar = mesonbuild.envconfig.BinaryTable.evarMap['{}ld'.format(lang)] + with mock.patch.dict(os.environ, {envvar: name}): env = get_fake_env() comp = getattr(env, 'detect_{}_compiler'.format(lang))(MachineChoice.HOST) if lang != 'rust' and comp.use_linker_args('foo') == []: |