--- /dev/null
+// Copyright (C) 2020 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#ifndef AGENT_TEST_BASIC_AUTH_LIBRARIES_H
+#define AGENT_TEST_BASIC_AUTH_LIBRARIES_H
+
+#include <config.h>
+
+namespace {
+
+// Names of the libraries used in these tests. These libraries are built using
+// libtool, so we need to look in the hidden ".libs" directory to locate the
+// .so file. Note that we access the .so file - libtool creates this as a
+// like to the real shared library.
+
+// Basic HTTP authentication as a callout library.
+static const char* BASIC_AUTH_LIBRARY = "@abs_builddir@/libbasicauth.so";
+
+} // anonymous namespace
+
+#endif // TEST_BASIC_AUTH_LIBRARIES_H
--- /dev/null
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#ifndef AGENT_TEST_CALLOUT_LIBRARIES_H
+#define AGENT_TEST_CALLOUT_LIBRARIES_H
+
+#include <config.h>
+
+namespace {
+
+// Names of the libraries used in these tests. These libraries are built using
+// libtool, so we need to look in the hidden ".libs" directory to locate the
+// .so file. Note that we access the .so file - libtool creates this as a
+// like to the real shared library.
+
+// Basic callout library with context_create and three "standard" callouts.
+static const char* CALLOUT_LIBRARY = "@abs_builddir@/libcallout.so";
+
+} // anonymous namespace
+
+#endif // TEST_LIBRARIES_H
endif
current_build_dir = meson.current_build_dir()
+kea_agent_tests_data = configuration_data()
+kea_agent_tests_data.set('abs_top_builddir', TOP_BUILD_DIR)
+kea_agent_tests_data.set('abs_top_srcdir', TOP_SOURCE_DIR)
+kea_agent_tests_data.set('abs_builddir', current_build_dir)
+ca_process_tests = configure_file(
+ input: 'ca_process_tests.sh.in',
+ output: 'ca_process_tests.sh',
+ configuration: kea_agent_tests_data,
+)
+test(
+ 'ca_process_tests.sh',
+ ca_process_tests,
+ workdir: current_build_dir,
+ is_parallel: false,
+ priority: -1,
+)
+configure_file(
+ input: 'meson-test_basic_auth_libraries.h.in',
+ output: 'test_basic_auth_libraries.h',
+ configuration: kea_agent_tests_data,
+)
+configure_file(
+ input: 'meson-test_callout_libraries.h.in',
+ output: 'test_callout_libraries.h',
+ configuration: kea_agent_tests_data,
+)
+configure_file(
+ input: 'test_data_files_config.h.in',
+ output: 'test_data_files_config.h',
+ configuration: kea_agent_tests_data,
+)
+current_source_dir = meson.current_source_dir()
+kea_agent_tests_libs = [
+ kea_process_testutils_lib,
+ kea_testutils_lib,
+ kea_asiolink_testutils_lib,
+]
kea_agent_tests = executable(
'kea-agent-tests',
- 'basic_auth_library.cc',
'ca_cfg_mgr_unittests.cc',
'ca_command_mgr_unittests.cc',
'ca_controller_unittests.cc',
'ca_response_creator_factory_unittests.cc',
'ca_response_creator_unittests.cc',
'ca_unittests.cc',
- 'callout_library.cc',
'get_config_unittest.cc',
'parser_unittests.cc',
cpp_args: [
+ f'-DTEST_DATA_BUILDDIR="@current_build_dir@"',
f'-DCFG_EXAMPLES="@TOP_SOURCE_DIR@/doc/examples/agent"',
f'-DSYNTAX_FILE="@current_source_dir@/../agent_parser.yy"',
f'-DTEST_CA_DIR="@TEST_CA_DIR@"',
- f'-DTEST_DATA_BUILDDIR="@current_build_dir@"',
],
dependencies: [gtest],
include_directories: [include_directories('.')] + INCLUDES,
- link_with: [agent_lib] + LIBS_BUILT_SO_FAR,
+ link_with: [agent_lib] + kea_agent_tests_libs + LIBS_BUILT_SO_FAR,
)
test('kea-agent-tests', kea_agent_tests, protocol: 'gtest')
+
+shared_library(
+ 'callout',
+ 'callout_library.cc',
+ include_directories: [include_directories('.')] + INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+ build_rpath: '/nowhere',
+ name_suffix: 'so',
+)
+shared_library(
+ 'basicauth',
+ 'basic_auth_library.cc',
+ include_directories: [include_directories('.')] + INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+ build_rpath: '/nowhere',
+ name_suffix: 'so',
+)