aboutsummaryrefslogtreecommitdiff
path: root/test cases/python
diff options
context:
space:
mode:
authorMichael Hirsch <scivision@users.noreply.github.com>2020-07-12 09:12:16 -0400
committerMichael Hirsch <scivision@users.noreply.github.com>2020-07-12 09:12:16 -0400
commit895de87b9069d1fca51c3550fe7d113a43f9e586 (patch)
treec26e08bd3379a89c7938822c1758df294c6d2bf3 /test cases/python
parent4f1a240bc2c2029f281330c13273bfc876219c45 (diff)
downloadmeson-895de87b9069d1fca51c3550fe7d113a43f9e586.zip
meson-895de87b9069d1fca51c3550fe7d113a43f9e586.tar.gz
meson-895de87b9069d1fca51c3550fe7d113a43f9e586.tar.bz2
some python test cases don't care about backend, so run them in any case
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 b4eb960..54c50b4 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 194920b..18c05d4 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 3835377..ccccdaf 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)