if get_option('unit-tests-backends')
libpdns_module_remotebackend_test_common = declare_dependency(
- link_with: static_library(
+ link_whole: static_library(
'pdns-test-remotebackend',
module_remotebackend_test_sources_common,
dependencies: [
deps,
+ module_remotebackend_lib,
libpdns_signers_pkcs11,
libpdns_common,
libpdns_dnslabeltext,
env = {
'BOOST_TEST_LOG_LEVEL': 'message',
- 'REMOTEBACKEND_ZEROMQ': get_option('module-remote-zeromq') ? '1' : '0',
+ 'REMOTEBACKEND_ZEROMQ': get_option('module-remote-zeromq') ? 'yes' : 'no',
}
+ verbose = get_option('unit-tests-verbose')
+
foreach test_binary, test_source: module_remotebackend_test_sources_binaries
- var_name = test_binary.underscorify()
+ exec_var_name = test_binary.underscorify()
set_variable(
- var_name,
+ exec_var_name,
executable(
test_binary,
test_source,
)
)
- test('PDNS Auth ' + test_binary, get_variable(var_name), verbose: true, env: env)
+ test(
+ 'pdns-auth-' + test_binary,
+ module_remotebackend_testrunner,
+ args: get_variable(exec_var_name).full_path(),
+ verbose: verbose,
+ env: env,
+ workdir: product_source_dir / fs.parent(module_remotebackend_testrunner),
+ is_parallel: false,
+ )
endforeach
endif
option('ipcipher', type: 'feature', value: 'auto', description: 'IPcipher (requires libcrypto)')
option('unit-tests', type: 'boolean', value: false, description: 'Build and run unit tests')
option('unit-tests-backends', type: 'boolean', value: false, description: 'Build and run backend unit tests')
+option('unit-tests-verbose', type: 'boolean', value: false, description: 'Print more unit test information')
option('reproducible', type: 'boolean', value: false, description: 'Reproducible builds (for distro maintainers, makes debugging difficult)')
option('fuzz-targets', type: 'boolean', value: false, description: 'Enable fuzzing targets')
option('verbose-logging', type: 'boolean', value: false, description: 'Enable verbose logging')
-sources = [
+sources = files(
'httpconnector.cc',
'pipeconnector.cc',
'remotebackend.cc',
'unixconnector.cc',
'zmqconnector.cc',
-]
+)
-extras = [
- 'testrunner.sh',
- 'unittest_http.rb',
- 'unittest_json.rb',
- 'unittest_pipe.rb',
- 'unittest_zeromq.rb',
- 'unittest_post.rb',
- 'unittest.rb',
- 'Gemfile',
- 'Gemfile.lock',
- # 'remotebackend_pipe.test',
- # 'remotebackend_unix.test',
- # 'remotebackend_http.test',
- # 'remotebackend_post.test',
- # 'remotebackend_json.test',
- # 'remotebackend_zeromq.test',
+extras = files(
'remotebackend.hh',
-]
+)
module_deps = [deps, dep_zeromq]
endif
if get_option('unit-tests-backends')
+ module_remotebackend_lib = declare_dependency(link_whole: lib)
+ module_remotebackend_testrunner = files('testrunner.sh')[0]
+
module_remotebackend_test_sources_common = files(
- 'httpconnector.cc',
- 'pipeconnector.cc',
- 'remotebackend.cc',
- 'unixconnector.cc',
- 'zmqconnector.cc',
'test-remotebackend.cc',
- 'remotebackend.hh',
'test-remotebackend-keys.hh',
)
}
module_remotebackend_test_sources_extra = files(
- 'testrunner.sh',
+ 'example.rb',
+ 'Gemfile',
+ 'Gemfile.lock',
'unittest_http.rb',
'unittest_json.rb',
'unittest_pipe.rb',
- 'unittest_zeromq.rb',
'unittest_post.rb',
'unittest.rb',
- 'Gemfile',
- 'Gemfile.lock',
+ 'unittest_zeromq.rb',
)
endif