From: Fred Morcos Date: Tue, 17 Oct 2023 18:49:30 +0000 (+0200) Subject: Meson: Cleanup the handling of unit tests and extra tools X-Git-Tag: rec-5.1.0-alpha1~80^2~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcbbf383cbf7a86cc56e4a3bd1d6956f75aa4016;p=thirdparty%2Fpdns.git Meson: Cleanup the handling of unit tests and extra tools --- diff --git a/meson.build b/meson.build index b28c9f4850..fda914fadb 100644 --- a/meson.build +++ b/meson.build @@ -57,16 +57,12 @@ subdir('meson' / 'ipcipher') # IPCipher subdir('meson' / 'clock-gettime') # Clock_gettime subdir('meson' / 'boost') # Boost subdir('meson' / 'boost-program-options') # Boost Program Options Library -subdir('meson' / 'unit-tests') # Unit Tests -subdir('meson' / 'auth-backend-unit-tests') # Auth Backend Unit Tests subdir('meson' / 'reproducible') # Reproducible Builds subdir('meson' / 'fuzz-targets') # Fuzzing Targets subdir('meson' / 'dlopen') # dlopen subdir('meson' / 'verbose-logging') # Verbose Logging subdir('meson' / 'pkcs11') # PKCS11 subdir('meson' / 'gss-tsig') # GSS-TSIG -subdir('meson' / 'auth-tools') # Tools -subdir('meson' / 'ixfrdist') # Ixfrdist subdir('meson' / 'systemd') # Systemd and unit file handling subdir('meson' / 'code-coverage') # Code coverage subdir('meson' / 'auto-var-init') # Automatic Variable Initialization @@ -76,6 +72,14 @@ subdir('meson' / 'socket-dir') # Socket Dir subdir('meson' / 'various-functions') # Various Functions subdir('meson' / 'various-headers') # Various Headers +if get_option('unit-tests') or get_option('unit-tests-backends') + subdir('meson' / 'boost-test') +endif + +if get_option('module-geoip') != 'disabled' or get_option('tools-ixfrdist') + subdir('meson' / 'yaml-cpp') +endif + # Manpages # if not fs.exists('docs' / 'pdns_server.1') and not python_have_venv # warning('Python3 and/or its venv module is not available and ' + @@ -104,12 +108,9 @@ deps = [ dep_rt, dep_boost, dep_boost_program_options, - dep_unittests, - dep_backend_unittests, dep_dlopen, dep_pkcs11, dep_gss_tsig, - dep_ixfrdist, dep_yahttp, dep_ipcrypt, dep_json11, @@ -130,7 +131,7 @@ all_modules = { 'lua2': {'deps': [], 'exts': []}, 'remote': {'deps': ['prog-curl', 'zeromq'], 'exts': []}, 'tinydns': {'deps': ['cdb'], 'exts': []}, - 'geoip': {'deps': ['geoip', 'mmdb', 'yaml-cpp'], 'exts': []}, + 'geoip': {'deps': ['geoip', 'mmdb'], 'exts': []}, 'lmdb': {'deps': ['lmdb', 'boost-serialization'], 'exts': ['lmdb-safe']}, } @@ -146,7 +147,7 @@ foreach module_name, module_props: all_modules foreach dep: module_deps if module_name == 'remote' if dep == 'prog-curl' - if not opt_unittests + if not get_option('unit-tests') continue # We only need cURL for unit tests. endif elif dep == 'zeromq' diff --git a/meson/auth-backend-unit-tests/meson.build b/meson/auth-backend-unit-tests/meson.build deleted file mode 100644 index 4ddf0b5125..0000000000 --- a/meson/auth-backend-unit-tests/meson.build +++ /dev/null @@ -1,14 +0,0 @@ -opt_backend_unittests = get_option('unit-tests-backends') -dep_backend_unittests = dependency('', required: false) - -conf.set('BACKEND_UNIT_TESTS', opt_backend_unittests, description: 'Backend unit tests') - -if opt_backend_unittests - dep_boost_test = dependency('boost', modules: ['unit_test_framework'], required: true) - - if not dep_unittests.found() - summary('Test', dep_boost_test.found(), bool_yn: true, section: 'Boost') - endif - - dep_backend_unittests = declare_dependency(dependencies: dep_boost_test) -endif diff --git a/meson/auth-tools/meson.build b/meson/auth-tools/meson.build deleted file mode 100644 index ca0f5fa24e..0000000000 --- a/meson/auth-tools/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -opt_tools = get_option('tools') -conf.set('TOOLS', opt_tools, description: 'Build the extra tools') -summary('Build `tools`', opt_tools, bool_yn: true, section: 'Configuration') diff --git a/meson/boost-test/meson.build b/meson/boost-test/meson.build new file mode 100644 index 0000000000..1af8127766 --- /dev/null +++ b/meson/boost-test/meson.build @@ -0,0 +1,2 @@ +dep_boost_test = dependency('boost', modules: ['unit_test_framework'], required: true) +summary('Test', dep_boost_test.found(), bool_yn: true, section: 'Boost') diff --git a/meson/ixfrdist/meson.build b/meson/ixfrdist/meson.build deleted file mode 100644 index 61e2706ca7..0000000000 --- a/meson/ixfrdist/meson.build +++ /dev/null @@ -1,10 +0,0 @@ -opt_ixfrdist = get_option('tools-ixfrdist') -dep_ixfrdist = dependency('', required: false) - -if opt_ixfrdist - dep_yaml_cpp = dependency('yaml-cpp', version: '>= 0.5', required: true) - dep_ixfrdist = declare_dependency(dependencies: dep_yaml_cpp) -endif - -conf.set('IXFRDIST', dep_ixfrdist.found(), description: 'Whether to build ixfrdist') -summary('Build `ixfrdist`', dep_ixfrdist.found(), bool_yn: true, section: 'Configuration') diff --git a/meson/unit-tests/meson.build b/meson/unit-tests/meson.build deleted file mode 100644 index 8538401c97..0000000000 --- a/meson/unit-tests/meson.build +++ /dev/null @@ -1,10 +0,0 @@ -opt_unittests = get_option('unit-tests') -dep_unittests = dependency('', required: false) - -conf.set('UNIT_TESTS', opt_unittests, description: 'Unit tests') - -if opt_unittests - dep_boost_test = dependency('boost', modules: ['unit_test_framework'], required: true) - summary('Test', dep_boost_test.found(), bool_yn: true, section: 'Boost') - dep_unittests = declare_dependency(dependencies: dep_boost_test) -endif