summaryrefslogtreecommitdiffstats
path: root/test cases/python/8 different python versions/meson.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:41:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:41:38 +0000
commit7b6e527f440cd7e6f8be2b07cee320ee6ca18786 (patch)
tree4a2738d69fa2814659fdadddf5826282e73d81f4 /test cases/python/8 different python versions/meson.build
parentInitial commit. (diff)
downloadmeson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.tar.xz
meson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.zip
Adding upstream version 1.0.1.upstream/1.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test cases/python/8 different python versions/meson.build')
-rw-r--r--test cases/python/8 different python versions/meson.build34
1 files changed, 34 insertions, 0 deletions
diff --git a/test cases/python/8 different python versions/meson.build b/test cases/python/8 different python versions/meson.build
new file mode 100644
index 0000000..2655b06
--- /dev/null
+++ b/test cases/python/8 different python versions/meson.build
@@ -0,0 +1,34 @@
+project('Python extension module', 'c',
+ default_options : ['buildtype=release'])
+
+py_mod = import('python')
+
+py = py_mod.find_installation(get_option('python'), required : false)
+
+# CI images don't have 32-bit python2 for 32-bit windows,
+# so this actually gets detected then fails
+require = not (
+ get_option('python') == 'python2' and
+ host_machine.system() == 'windows' and
+ host_machine.cpu() == 'x86'
+)
+
+if py.found()
+ py_dep = py.dependency(required: require)
+
+ if py_dep.found()
+ subdir('ext')
+
+ test('extmod',
+ py,
+ args : files('blaster.py'),
+ env : ['PYTHONPATH=' + pypathdir])
+ else
+ error('MESON_SKIP_TEST: Python libraries not found, skipping test.')
+ endif
+else
+ error('MESON_SKIP_TEST: Python not found, skipping test.')
+endif
+
+py = py_mod.find_installation(get_option('python'), required : get_option('disabled_opt'))
+assert(not py.found(), 'find_installation not working with disabled feature')