From 895de87b9069d1fca51c3550fe7d113a43f9e586 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Sun, 12 Jul 2020 09:12:16 -0400 Subject: some python test cases don't care about backend, so run them in any case --- test cases/python/2 extmodule/meson.build | 4 +++ test cases/python/3 cython/meson.build | 35 +++++++++++++--------- .../4 custom target depends extmodule/meson.build | 4 +++ 3 files changed, 29 insertions(+), 14 deletions(-) (limited to 'test cases/python') 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) -- cgit v1.2.3