Skip pkg-config-dependent tests if it's missing

pull/12642/head
Alyssa Ross 12 months ago committed by Eli Schwartz
parent e991c4d454
commit 9322a29d7f
  1. 1
      unittests/linuxliketests.py
  2. 9
      unittests/machinefiletests.py

@ -928,6 +928,7 @@ class LinuxlikeTests(BasePlatformTests):
install_rpath = get_rpath(os.path.join(self.installdir, 'usr/bin/progcxx'))
self.assertEqual(install_rpath, 'baz:/foo/dummy')
@skipIfNoPkgconfig
def test_global_rpath(self):
if is_cygwin():
raise SkipTest('Windows PE/COFF binaries do not use RPATH')

@ -215,9 +215,12 @@ class NativeFileTests(BasePlatformTests):
# We not have python2, check for it
for v in ['2', '2.7', '-2.7']:
rc = subprocess.call(['pkg-config', '--cflags', f'python{v}'],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL)
try:
rc = subprocess.call(['pkg-config', '--cflags', f'python{v}'],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL)
except FileNotFoundError:
raise SkipTest('Not running Python 2 tests because pkg-config not found.')
if rc == 0:
break
else:

Loading…
Cancel
Save