diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:26:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:26:00 +0000 |
commit | 830407e88f9d40d954356c3754f2647f91d5c06a (patch) | |
tree | d6a0ece6feea91f3c656166dbaa884ef8a29740e /tests/meson.build | |
parent | Initial commit. (diff) | |
download | knot-resolver-830407e88f9d40d954356c3754f2647f91d5c06a.tar.xz knot-resolver-830407e88f9d40d954356c3754f2647f91d5c06a.zip |
Adding upstream version 5.6.0.upstream/5.6.0upstream
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 |