diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 20:37:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 20:37:50 +0000 |
commit | c1f743ab2e4a7046d5500875a47d1f62c8624603 (patch) | |
tree | 709946d52f5f3bbaeb38be9e3f1d56d11f058237 /tests/meson.build | |
parent | Initial commit. (diff) | |
download | knot-resolver-c1f743ab2e4a7046d5500875a47d1f62c8624603.tar.xz knot-resolver-c1f743ab2e4a7046d5500875a47d1f62c8624603.zip |
Adding upstream version 5.7.1.upstream/5.7.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/meson.build')
-rw-r--r-- | tests/meson.build | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 0000000..818169d --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,61 @@ +# tests +# SPDX-License-Identifier: GPL-3.0-or-later + +## unit tests +build_unit_tests = false +if get_option('unit_tests') != 'disabled' + message('--- unit_tests dependencies ---') + cmocka = dependency('cmocka', required: get_option('unit_tests') == 'enabled') + if cmocka.found() + build_unit_tests = true + subdir('unit') + endif + message('-------------------------------') +endif + +build_extra_tests = get_option('extra_tests') == 'enabled' +build_config_tests = get_option('config_tests') == 'enabled' +if get_option('config_tests') == 'auto' + build_config_tests = build_extra_tests +endif + +## config tests +if build_config_tests + message('--- config_tests dependencies ---') + cqueues = run_command('luajit', '-l', 'cqueues', '-e', 'os.exit(0)', check: false) # luajit -l $(1) -e "os.exit(0)" + if cqueues.returncode() != 0 + error('missing luajit package: cqueues') + endif + basexx = run_command('luajit', '-l', 'basexx', '-e', 'os.exit(0)', check: false) # luajit -l $(1) -e "os.exit(0)" + if basexx.returncode() != 0 + error('missing luajit package: basexx') + endif + ffi = run_command('luajit', '-l', 'ffi', '-e', 'os.exit(0)', check: false) # luajit -l $(1) -e "os.exit(0)" + if ffi.returncode() != 0 + error('missing luajit package: ffi') + endif + message('---------------------------------') + + subdir('config') +endif + +## extra tests +if build_extra_tests + message('--- extra_tests dependencies ---') + python3 = find_program('python3') + py3_deps = [] + + subdir('pytests') + subdir('integration') + if build_dnstap + subdir('dnstap') + endif + + foreach py3_dep : py3_deps + py3_import = run_command(python3, '-c', 'import @0@'.format(py3_dep[0]), check: false) + if py3_import.returncode() != 0 + error('missing python3 dependency: @0@'.format(py3_dep[1])) + endif + endforeach + message('--------------------------------') +endif |