Skip to content

Commit

Permalink
Skip pkg-config-dependent tests if it's missing
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssais authored and eli-schwartz committed Dec 17, 2023
1 parent e991c4d commit 9322a29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions unittests/linuxliketests.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,7 @@ def test_build_rpath_pkgconfig(self):
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')
Expand Down
9 changes: 6 additions & 3 deletions unittests/machinefiletests.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,12 @@ def test_python_module(self):

# 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:
Expand Down

0 comments on commit 9322a29

Please sign in to comment.