2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00

[#3729] Added libyang UTs

This commit is contained in:
Francis Dupont
2025-02-11 23:13:13 +01:00
committed by Andrei Pavel
parent 0ffc8ad918
commit 1e1effef2f
5 changed files with 66 additions and 1 deletions

View File

@@ -168,10 +168,13 @@ krb5_config = find_program('krb5-config', required: false)
if krb5_config.found()
cflags = run_command([krb5_config, '--cflags', 'gssapi'], check: false)
libs = run_command([krb5_config, '--libs', 'gssapi'], check: false)
if cflags.returncode() == 0 and libs.returncode() == 0
version = run_command([krb5_config, '--version'], check: false)
if cflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0
krb5_version = version.stdout().strip()
krb5 = declare_dependency(
compile_args: cflags.stdout().split(),
link_args: libs.stdout().split(),
version: krb5_version,
)
endif
endif

View File

@@ -56,3 +56,6 @@ kea_yang_headers = [
'yang_revisions.h',
]
install_headers(kea_yang_headers, preserve_path: true, subdir: 'kea/yang')
subdir('testutils')
subdir('pretests')
subdir('tests')

View File

@@ -0,0 +1,11 @@
if not gtest.found()
subdir_done()
endif
sysrepo_setup_tests = executable(
'kea-sysrepo-setup-tests',
'sysrepo_setup_tests.cc',
dependencies: netconf_deps_array,
include_directories: [include_directories('.')] + INCLUDES,
)
test('sysrepo_setup_tests', sysrepo_setup_tests)

View File

@@ -0,0 +1,38 @@
if not gtest.found()
subdir_done()
endif
kea_yang_tests_libs = [
kea_yang_testutils_lib,
kea_testutils_lib,
kea_util_unittests_lib,
]
kea_yang_tests = executable(
'kea-yang-tests',
'adaptor_config_unittests.cc',
'adaptor_host_unittests.cc',
'adaptor_option_unittests.cc',
'adaptor_pool_unittests.cc',
'adaptor_subnet_unittests.cc',
'adaptor_unittests.cc',
'config_unittests.cc',
'run_unittests.cc',
'translator_class_unittests.cc',
'translator_control_socket_unittests.cc',
'translator_database_unittests.cc',
'translator_host_unittests.cc',
'translator_logger_unittests.cc',
'translator_option_data_unittests.cc',
'translator_option_def_unittests.cc',
'translator_pd_pool_unittests.cc',
'translator_pool_unittests.cc',
'translator_shared_network_unittests.cc',
'translator_subnet_unittests.cc',
'translator_unittests.cc',
'translator_utils_unittests.cc',
cpp_args: [f'-DCFG_EXAMPLES="@TOP_SOURCE_DIR@/doc/examples"'],
dependencies: netconf_deps_array + [gtest],
include_directories: [include_directories('.')] + INCLUDES,
link_with: kea_yang_tests_libs + LIBS_BUILT_SO_FAR,
)
test('kea_yang_tests', kea_yang_tests, protocol: 'gtest')

View File

@@ -0,0 +1,10 @@
if not gtest.found()
subdir_done()
endif
kea_yang_testutils_lib = static_library(
'kea-yang-testutils',
'translator_test.cc',
dependencies: netconf_deps_array + [gtest],
include_directories: [include_directories('.')] + INCLUDES,
)