--- /dev/null
+// Copyright (C) 2013-2016 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 TEST_LIBRARIES_H
+#define TEST_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
+// shared library.
+
+// Library with load/unload functions creating marker files to check their
+// operation.
+static const char* CALLOUT_LIBRARY_1 = "@abs_builddir@/libco1.so";
+static const char* CALLOUT_LIBRARY_2 = "@abs_builddir@/libco2.so";
+
+// This library will try to get the following parameters:
+// - svalue (and will expect its value to be "string value")
+// - ivalue (and will expect its value to be 42)
+// - bvalue (and will expect its value to be true)
+static const char* CALLOUT_PARAMS_LIBRARY = "@abs_builddir@/libco3.so";
+
+// Name of a library which is not present.
+static const char* NOT_PRESENT_LIBRARY = "@abs_builddir@/libnothere.so";
+
+} // anonymous namespace
+
+
+#endif // TEST_LIBRARIES_H
output: 'test_kea_lfc_env.sh',
copy: true,
)
+kea_dhcpsrv_conf_data = configuration_data()
+kea_dhcpsrv_conf_data.set('abs_builddir', meson.current_build_dir())
+configure_file(
+ input: 'meson-test_libraries.h.in',
+ output: 'test_libraries.h',
+ configuration: kea_dhcpsrv_conf_data,
+)
kea_dhcpsrv_tests = executable(
'kea-dhcpsrv-tests',
'alloc_engine4_unittest.cc',
'd2_client_unittest.cc',
'd2_udp_unittest.cc',
'dhcp4o6_ipc_unittest.cc',
- # 'dhcp_parsers_unittest.cc',
+ 'dhcp_parsers_unittest.cc',
'dhcp_queue_control_parser_unittest.cc',
'duid_config_parser_unittest.cc',
'expiration_config_parser_unittest.cc',
protocol: 'gtest',
is_parallel: false,
)
+
+shared_library(
+ 'co1',
+ 'callout_library.cc',
+ include_directories: [include_directories('.')] + INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+ build_rpath: '/nowhere',
+ name_suffix: 'so',
+)
+shared_library(
+ 'co2',
+ 'callout_library.cc',
+ include_directories: [include_directories('.')] + INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+ build_rpath: '/nowhere',
+ name_suffix: 'so',
+)
+shared_library(
+ 'co3',
+ 'callout_params_library.cc',
+ include_directories: [include_directories('.')] + INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+ build_rpath: '/nowhere',
+ name_suffix: 'so',
+)
--- /dev/null
+// Copyright (C) 2013-2018 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 TEST_LIBRARIES_H
+#define TEST_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 library with context_create and three "standard" callouts.
+static const char* BASIC_CALLOUT_LIBRARY = "@abs_builddir@/libbcl.so";
+
+// Library with context_create and three "standard" callouts, as well as
+// load() and unload() functions.
+static const char* FULL_CALLOUT_LIBRARY = "@abs_builddir@/libfcl.so";
+
+// Library where the all framework functions throw an exception
+static const char* FRAMEWORK_EXCEPTION_LIBRARY = "@abs_builddir@/libfxl.so";
+
+// Library where the version() function returns an incorrect result.
+static const char* INCORRECT_VERSION_LIBRARY = "@abs_builddir@/libivl.so";
+
+// Library where some of the callout registration is done with the load()
+// function.
+static const char* LOAD_CALLOUT_LIBRARY = "@abs_builddir@/liblcl.so";
+
+// Library where the load() function returns an error.
+static const char* LOAD_ERROR_CALLOUT_LIBRARY =
+ "@abs_builddir@/liblecl.so";
+
+// Name of a library which is not present.
+static const char* NOT_PRESENT_LIBRARY = "@abs_builddir@/libnothere.so";
+
+// Library that does not include a version function.
+static const char* NO_VERSION_LIBRARY = "@abs_builddir@/libnvl.so";
+
+// Library where there is an unload() function.
+static const char* UNLOAD_CALLOUT_LIBRARY = "@abs_builddir@/libucl.so";
+
+// Library where parameters are checked.
+static const char* CALLOUT_PARAMS_LIBRARY = "@abs_builddir@/libpcl.so";
+
+// Library which tests objects parking.
+// Used only by hooks_manager_unittest.cc.
+#ifdef TEST_ASYNC_CALLOUT
+static const char* ASYNC_CALLOUT_LIBRARY = "@abs_builddir@/libacl.so";
+#endif
+
+} // anonymous namespace
+
+
+#endif // TEST_LIBRARIES_H
'callout_handle_unittest.cc',
'callout_manager_unittest.cc',
'handles_unittest.cc',
- # 'hooks_manager_unittest.cc',
- # 'library_manager_collection_unittest.cc',
- # 'library_manager_unittest.cc',
+ 'hooks_manager_unittest.cc',
+ 'library_manager_collection_unittest.cc',
+ 'library_manager_unittest.cc',
'parking_lots_unittest.cc',
'run_unittests.cc',
'server_hooks_unittest.cc',
link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
)
test('kea_hooks_tests', kea_hooks_tests, protocol: 'gtest')
+
+kea_hooks_conf_data = configuration_data()
+kea_hooks_conf_data.set('abs_builddir', meson.current_build_dir())
+configure_file(
+ input: 'marker_file.h.in',
+ output: 'marker_file.h',
+ configuration: kea_hooks_conf_data,
+)
+configure_file(
+ input: 'meson-test_libraries.h.in',
+ output: 'test_libraries.h',
+ configuration: kea_hooks_conf_data,
+)
+
+shared_library(
+ 'nvl',
+ 'no_version_library.cc',
+ include_directories: [include_directories('.')] + INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+ build_rpath: '/nowhere',
+ name_suffix: 'so',
+)
+shared_library(
+ 'ivl',
+ 'incorrect_version_library.cc',
+ include_directories: [include_directories('.')] + INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+ build_rpath: '/nowhere',
+ name_suffix: 'so',
+)
+shared_library(
+ 'fxl',
+ 'framework_exception_library.cc',
+ include_directories: [include_directories('.')] + INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+ build_rpath: '/nowhere',
+ name_suffix: 'so',
+)
+shared_library(
+ 'bcl',
+ 'basic_callout_library.cc',
+ include_directories: [include_directories('.')] + INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+ build_rpath: '/nowhere',
+ name_suffix: 'so',
+)
+shared_library(
+ 'lcl',
+ 'load_callout_library.cc',
+ include_directories: [include_directories('.')] + INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+ build_rpath: '/nowhere',
+ name_suffix: 'so',
+)
+shared_library(
+ 'lecl',
+ 'load_error_callout_library.cc',
+ include_directories: [include_directories('.')] + INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+ build_rpath: '/nowhere',
+ name_suffix: 'so',
+)
+shared_library(
+ 'ucl',
+ 'unload_callout_library.cc',
+ include_directories: [include_directories('.')] + INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+ build_rpath: '/nowhere',
+ name_suffix: 'so',
+)
+shared_library(
+ 'fcl',
+ 'full_callout_library.cc',
+ include_directories: [include_directories('.')] + INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+ build_rpath: '/nowhere',
+ name_suffix: 'so',
+)
+shared_library(
+ 'pcl',
+ 'callout_params_library.cc',
+ include_directories: [include_directories('.')] + INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+ build_rpath: '/nowhere',
+ name_suffix: 'so',
+)
+shared_library(
+ 'acl',
+ 'async_callout_library.cc',
+ include_directories: [include_directories('.')] + INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+ build_rpath: '/nowhere',
+ name_suffix: 'so',
+)