summaryrefslogtreecommitdiff
path: root/unittests/machinefiletests.py
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-12-15 18:28:00 +0100
committerEli Schwartz <eschwartz93@gmail.com>2023-12-17 16:21:11 -0500
commit9322a29d7f359cbcf378408e0080ea2b030b0d5b (patch)
tree175330a45357bcdb5031bf40bca15078e1185d94 /unittests/machinefiletests.py
parente991c4d45460c09e5eaee6cb1041edb95d1e990e (diff)
downloadmeson-9322a29d7f359cbcf378408e0080ea2b030b0d5b.tar.gz
Skip pkg-config-dependent tests if it's missing
Diffstat (limited to 'unittests/machinefiletests.py')
-rw-r--r--unittests/machinefiletests.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/unittests/machinefiletests.py b/unittests/machinefiletests.py
index c3802618d..22341cb9a 100644
--- a/unittests/machinefiletests.py
+++ b/unittests/machinefiletests.py
@@ -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: