summaryrefslogtreecommitdiff
path: root/test cases/python
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/python')
-rw-r--r--test cases/python/2 extmodule/meson.build4
-rw-r--r--test cases/python/3 cython/meson.build35
-rw-r--r--test cases/python/4 custom target depends extmodule/meson.build4
3 files changed, 29 insertions, 14 deletions
diff --git a/test cases/python/2 extmodule/meson.build b/test cases/python/2 extmodule/meson.build
index b4eb96039..54c50b4be 100644
--- a/test cases/python/2 extmodule/meson.build
+++ b/test cases/python/2 extmodule/meson.build
@@ -3,6 +3,10 @@ project('Python extension module', 'c',
# Because Windows Python ships only with optimized libs,
# we must build this project the same way.
+if meson.backend() != 'ninja'
+ error('MESON_SKIP_TEST: Ninja backend required')
+endif
+
py_mod = import('python')
py = py_mod.find_installation()
py_dep = py.dependency()
diff --git a/test cases/python/3 cython/meson.build b/test cases/python/3 cython/meson.build
index 194920bd8..18c05d4d5 100644
--- a/test cases/python/3 cython/meson.build
+++ b/test cases/python/3 cython/meson.build
@@ -1,20 +1,27 @@
project('cython', 'c',
default_options : ['warning_level=3'])
-cython = find_program('cython3', required : false)
-py3_dep = dependency('python3', required : false)
+if meson.backend() != 'ninja'
+ error('MESON_SKIP_TEST: Ninja backend required')
+endif
-if cython.found() and py3_dep.found()
- py_mod = import('python')
- py3 = py_mod.find_installation()
- py3_dep = py3.dependency()
- subdir('libdir')
+cython = find_program('cython', required : false)
+if not cython.found()
+ error('MESON_SKIP_TEST: Cython3 not found.')
+endif
- test('cython tester',
- py3,
- args : files('cytest.py'),
- env : ['PYTHONPATH=' + pydir]
- )
-else
- error('MESON_SKIP_TEST: Cython3 or Python3 libraries not found, skipping test.')
+py3_dep = dependency('python3', required : false)
+if not py3_dep.found()
+ error('MESON_SKIP_TEST: Python library not found.')
endif
+
+py_mod = import('python')
+py3 = py_mod.find_installation()
+py3_dep = py3.dependency()
+subdir('libdir')
+
+test('cython tester',
+ py3,
+ args : files('cytest.py'),
+ env : ['PYTHONPATH=' + pydir]
+)
diff --git a/test cases/python/4 custom target depends extmodule/meson.build b/test cases/python/4 custom target depends extmodule/meson.build
index 38353772c..ccccdafbe 100644
--- a/test cases/python/4 custom target depends extmodule/meson.build
+++ b/test cases/python/4 custom target depends extmodule/meson.build
@@ -3,6 +3,10 @@ project('Python extension module', 'c',
# Because Windows Python ships only with optimized libs,
# we must build this project the same way.
+if meson.backend() != 'ninja'
+ error('MESON_SKIP_TEST: Ninja backend required')
+endif
+
py_mod = import('python')
py3 = py_mod.find_installation()
py3_dep = py3.dependency(required : false)