aboutsummaryrefslogtreecommitdiff
path: root/test cases/python3
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-11-05 21:12:25 -0400
committerEli Schwartz <eschwartz@archlinux.org>2022-11-14 19:16:57 -0500
commitaa84c55bef6393b00b3c86eed77bfc00756c7ce9 (patch)
tree21ebe6778835e47b0ccf4a0f08f10d7cc33eb38e /test cases/python3
parent6860e42c065a61cee2f31615fab99af1e20c8e50 (diff)
downloadmeson-aa84c55bef6393b00b3c86eed77bfc00756c7ce9.zip
meson-aa84c55bef6393b00b3c86eed77bfc00756c7ce9.tar.gz
meson-aa84c55bef6393b00b3c86eed77bfc00756c7ce9.tar.bz2
tests: fix edge case where non-default python is used, by skipping it
In a couple of python module tests, we try to test things that rely on the default python being the same one we look up in the python module. This is unsolvable for the deprecated python3 module, as it actually uses the in-process version of python for everything. For the python module, we could actually look up the default system python instead of the one we are running with, but then we wouldn't be testing the functionality of that alternative python... and also the install manifest tests would see files installed for the wrong version of python, and report a combination of missing+extra files... Solve both tests by just skipping the parts we cannot check.
Diffstat (limited to 'test cases/python3')
-rw-r--r--test cases/python3/3 cython/meson.build6
1 files changed, 6 insertions, 0 deletions
diff --git a/test cases/python3/3 cython/meson.build b/test cases/python3/3 cython/meson.build
index 753b906..d41fc93 100644
--- a/test cases/python3/3 cython/meson.build
+++ b/test cases/python3/3 cython/meson.build
@@ -6,8 +6,14 @@ py3_dep = dependency('python3', required : false)
if cython.found() and py3_dep.found()
py3_dep = dependency('python3')
+ py3_dep_majver = py3_dep.version().split('.')
+ py3_dep_majver = py3_dep_majver[0] + '.' + py3_dep_majver[1]
py3_mod = import('python3')
py3 = py3_mod.find_python()
+ if py3_dep_majver != py3_mod.language_version()
+ v = py3_mod.language_version()
+ error('MESON_SKIP_TEST: deprecated python3 module is non-functional when default python3 is different from Meson\'s', v)
+ endif
subdir('libdir')
test('cython tester',