From 830407e88f9d40d954356c3754f2647f91d5c06a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:26:00 +0200 Subject: Adding upstream version 5.6.0. Signed-off-by: Daniel Baumann --- tests/meson.build | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 tests/meson.build (limited to 'tests/meson.build') 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 -- cgit v1.2.3