From: Tomas Krizek Date: Mon, 4 Feb 2019 19:02:25 +0000 (+0100) Subject: meson: tests - check for py3_deps X-Git-Tag: v4.0.0~24^2~182 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=56e316eed80766bcb1e9de162c31962ee95c73bb;p=thirdparty%2Fknot-resolver.git meson: tests - check for py3_deps --- diff --git a/tests/meson.build b/tests/meson.build index 85d204f89..2cd7f9517 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -3,7 +3,16 @@ subdir('unit') if get_option('extra_tests') python3 = find_program('python3') + py3_deps = [] subdir('pytests') #subdir('integration') + + foreach py3_dep : py3_deps + py3_import = run_command(python3, '-c', 'import @0@'.format(py3_dep[0])) + if py3_import.returncode() != 0 + error('missing python3 dependency: @0@'.format(py3_dep[1])) + endif + endforeach + endif diff --git a/tests/pytests/meson.build b/tests/pytests/meson.build index 4785af7ea..97f3d5a84 100644 --- a/tests/pytests/meson.build +++ b/tests/pytests/meson.build @@ -19,18 +19,13 @@ tlsproxy = executable( pytest = find_program('pytest') # python 3 dependencies -pytest_py3_deps = [ - ['jinja2', 'jinja2'], - ['dnspython', 'dns'], - ['pytest-html', 'pytest_html'], - ['pytest-xdist', 'xdist'], +py3_deps += [ + ['jinja2', 'jinja2 (for pytests)'], + ['dns', 'dnspython (for pytests)'], + ['pytest', 'pytest (for pytests)'], + ['pytest_html', 'pytest-html (for pytests)'], + ['xdist', 'pytest-xdist (for pytests)'], ] -foreach py3_dep : pytest_py3_deps - py3_import = run_command(python3, '-c', 'import @0@'.format(py3_dep[1])) - if py3_import.returncode() != 0 - error('missing pytests dependency: python3 @0@'.format(py3_dep[0])) - endif -endforeach pytests_env = environment() pytests_env.prepend('PATH', kresd_install_path)