]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
meson: tests - check for py3_deps
authorTomas Krizek <tomas.krizek@nic.cz>
Mon, 4 Feb 2019 19:02:25 +0000 (20:02 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 12 Mar 2019 09:43:22 +0000 (10:43 +0100)
tests/meson.build
tests/pytests/meson.build

index 85d204f899e9ba64adf706e8758a9224a202d877..2cd7f9517c072bc62cf918e27ccfe9307da3990b 100644 (file)
@@ -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
index 4785af7ea67b388e7b8d094e8e0b0f38dcdf352f..97f3d5a84acbd3afaea02f7d49e188342271840d 100644 (file)
@@ -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)