Avoid module patching in `test_find_library_patterns`
This is less hacky, and also prepares the way for
@@ -763,18 +763,13 @@ class InternalTests(unittest.TestCase):
self._test_all_naming(cc, env, patterns, 'openbsd')
else:
self._test_all_naming(cc, env, patterns, 'linux')
- true = lambda x, y: True
- with PatchModule(mesonbuild.compilers.c.for_openbsd,
- 'mesonbuild.compilers.c.for_openbsd', true):
+ env.machines.host.system = 'openbsd'
self._test_all_naming(cc, env, patterns, 'openbsd')
- with PatchModule(mesonbuild.compilers.c.for_darwin,
- 'mesonbuild.compilers.c.for_darwin', true):
+ env.machines.host.system = 'darwin'
self._test_all_naming(cc, env, patterns, 'darwin')
- with PatchModule(mesonbuild.compilers.c.for_cygwin,
- 'mesonbuild.compilers.c.for_cygwin', true):
+ env.machines.host.system = 'cygwin'
self._test_all_naming(cc, env, patterns, 'cygwin')
- with PatchModule(mesonbuild.compilers.c.for_windows,
- 'mesonbuild.compilers.c.for_windows', true):
+ env.machines.host.system = 'windows'
self._test_all_naming(cc, env, patterns, 'windows-mingw')
def test_pkgconfig_parse_libs(self):
