--- /dev/null
+if not gtest.found()
+ subdir_done()
+endif
+
+HOOK_INCLUDES = [include_directories('..')]
+dhcp_bootp_libload_tests = executable(
+ 'dhcp-bootp-libload-tests',
+ 'load_unload_unittests.cc',
+ 'run_unittests.cc',
+ cpp_args: [
+ f'-DLIBDHCP_BOOTP_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/bootp/libdhcp_bootp.so"',
+ ],
+ dependencies: [gtest, crypto],
+ include_directories: [include_directories('.')] + INCLUDES + HOOK_INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+)
+test('dhcp_bootp_libload_tests', dhcp_bootp_libload_tests, protocol: 'gtest')
-dhcp_bootp_lib = library(
+dhcp_bootp_lib = shared_library(
'dhcp_bootp',
'bootp_callouts.cc',
'bootp_log.cc',
link_with: LIBS_BUILT_SO_FAR,
name_suffix: 'so',
)
+dhcp_bootp_archive = static_library(
+ 'dhcp_bootp',
+ objects: dhcp_bootp_lib.extract_all_objects(recursive: false),
+ link_with: LIBS_BUILT_SO_FAR,
+)
+subdir('tests')
+subdir('libloadtests')
--- /dev/null
+if not gtest.found()
+ subdir_done()
+endif
+
+HOOK_INCLUDES = [include_directories('..')]
+dhcp_bootp_lib_tests = executable(
+ 'dhcp-bootp-lib-tests',
+ 'bootp_unittests.cc',
+ 'run_unittests.cc',
+ cpp_args: [
+ f'-DBOOTP_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/bootp/libdhcp_bootp.so"',
+ ],
+ dependencies: [gtest],
+ include_directories: [include_directories('.')] + INCLUDES + HOOK_INCLUDES,
+ link_with: [dhcp_bootp_archive] + LIBS_BUILT_SO_FAR,
+)
+test('dhcp_bootp_lib_tests', dhcp_bootp_lib_tests, protocol: 'gtest')