diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2021-09-25 11:21:35 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-09-25 18:12:14 -0700 |
commit | 7f0193e294b731f595ae2c74eef0b4c256f9bb72 (patch) | |
tree | e8710601e046d3c69035d344cca10128ff619668 /unittests | |
parent | 8c020055954bd1e4807c8f4a963deb7f496a713a (diff) | |
download | meson-7f0193e294b731f595ae2c74eef0b4c256f9bb72.zip meson-7f0193e294b731f595ae2c74eef0b4c256f9bb72.tar.gz meson-7f0193e294b731f595ae2c74eef0b4c256f9bb72.tar.bz2 |
unittests: Make test_prelinking work on Solaris
Running 'cc --version' finds the Solaris Studio C compiler, not gcc,
and it doesn't support --version.
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/linuxliketests.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py index 2bcf5c9..8631f30 100644 --- a/unittests/linuxliketests.py +++ b/unittests/linuxliketests.py @@ -1676,10 +1676,13 @@ class LinuxlikeTests(BasePlatformTests): raise SkipTest('Prelinking not supported on Darwin.') if 'clang' in os.environ.get('CC', 'dummy'): raise SkipTest('Prelinking not supported with Clang.') - gccver = subprocess.check_output(['cc', '--version']) - if b'7.5.0' in gccver: - raise SkipTest('GCC on Bionic is too old to be supported.') testdir = os.path.join(self.unit_test_dir, '87 prelinking') + env = get_fake_env(testdir, self.builddir, self.prefix) + cc = detect_c_compiler(env, MachineChoice.HOST) + if cc.id == "gcc": + gccver = subprocess.check_output(['gcc', '--version']) + if b'7.5.0' in gccver: + raise SkipTest('GCC on Bionic is too old to be supported.') self.init(testdir) self.build() outlib = os.path.join(self.builddir, 'libprelinked.a') |