diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-09-11 18:35:02 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-09-19 15:18:59 -0400 |
commit | 0a9048e5546c17a926fd199ded798fba0f76b036 (patch) | |
tree | 0d6eb84d073fc271e39e178c49ef3b4afc922746 /unittests | |
parent | 24ac3cdb9c403fa43553cece086666f48ece1b95 (diff) | |
download | meson-0a9048e5546c17a926fd199ded798fba0f76b036.zip meson-0a9048e5546c17a926fd199ded798fba0f76b036.tar.gz meson-0a9048e5546c17a926fd199ded798fba0f76b036.tar.bz2 |
compilers: don't use instance checks to determine properties
In various situations we want to figure out what type of compiler we
have, because we want to know stuff like "is it the pgi one", or "does
it use msvc style". The compiler object has this property already, via
an API specifically designed to communicate this info, but instead we
performed isinstance checks on a compiler class.
This is confusing and indirect, and has the side effect of requiring
more imports everywhere. We should do away with it.
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/windowstests.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/unittests/windowstests.py b/unittests/windowstests.py index 7339ca8..c81d924 100644 --- a/unittests/windowstests.py +++ b/unittests/windowstests.py @@ -32,7 +32,6 @@ from mesonbuild.mesonlib import ( ) from mesonbuild.compilers import ( detect_c_compiler, detect_d_compiler, compiler_from_language, - GnuLikeCompiler ) from mesonbuild.programs import ExternalProgram import mesonbuild.dependencies.base @@ -222,21 +221,21 @@ class WindowsTests(BasePlatformTests): def test_link_environment_variable_lld_link(self): env = get_fake_env() comp = detect_c_compiler(env, MachineChoice.HOST) - if isinstance(comp, GnuLikeCompiler): + if comp.get_argument_syntax() == 'gcc': raise SkipTest('GCC cannot be used with link compatible linkers.') self._check_ld('lld-link', 'c', 'lld-link') def test_link_environment_variable_link(self): env = get_fake_env() comp = detect_c_compiler(env, MachineChoice.HOST) - if isinstance(comp, GnuLikeCompiler): + if comp.get_argument_syntax() == 'gcc': raise SkipTest('GCC cannot be used with link compatible linkers.') self._check_ld('link', 'c', 'link') def test_link_environment_variable_optlink(self): env = get_fake_env() comp = detect_c_compiler(env, MachineChoice.HOST) - if isinstance(comp, GnuLikeCompiler): + if comp.get_argument_syntax() == 'gcc': raise SkipTest('GCC cannot be used with link compatible linkers.') self._check_ld('optlink', 'c', 'optlink') |