]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3729] Added bootp tests (tentative)
authorFrancis Dupont <fdupont@isc.org>
Thu, 6 Feb 2025 03:03:47 +0000 (04:03 +0100)
committerAndrei Pavel <andrei@isc.org>
Thu, 13 Feb 2025 08:05:20 +0000 (10:05 +0200)
src/hooks/dhcp/bootp/libloadtests/meson.build [new file with mode: 0644]
src/hooks/dhcp/bootp/meson.build
src/hooks/dhcp/bootp/tests/meson.build [new file with mode: 0644]

diff --git a/src/hooks/dhcp/bootp/libloadtests/meson.build b/src/hooks/dhcp/bootp/libloadtests/meson.build
new file mode 100644 (file)
index 0000000..b7bef81
--- /dev/null
@@ -0,0 +1,17 @@
+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')
index 3beb92194b403deb4c0e282fc4012d982b08714f..dc0ad001717d8bc3ff2efe08083a85f2243da8fc 100644 (file)
@@ -1,4 +1,4 @@
-dhcp_bootp_lib = library(
+dhcp_bootp_lib = shared_library(
     'dhcp_bootp',
     'bootp_callouts.cc',
     'bootp_log.cc',
@@ -11,3 +11,10 @@ dhcp_bootp_lib = library(
     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')
diff --git a/src/hooks/dhcp/bootp/tests/meson.build b/src/hooks/dhcp/bootp/tests/meson.build
new file mode 100644 (file)
index 0000000..b1f8be6
--- /dev/null
@@ -0,0 +1,17 @@
+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')