From 883d49d93c3624ca270a9155b6e0db70293c8ec4 Mon Sep 17 00:00:00 2001 From: roman Date: Thu, 26 Oct 2023 16:18:22 +0200 Subject: [PATCH] cmake BUGFIX move compiling ssh/tls client tests --- tests/CMakeLists.txt | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3b3a4088..01c7db53 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -9,13 +9,25 @@ endif() # list of all the tests that don't require SSH and TLS set(tests test_unix_socket test_client_thread test_fd_comm test_init_destroy_client test_init_destroy_server - test_io test_thread_messages test_client_messages test_client_ssh test_client_tls) + test_io test_thread_messages test_client_messages) # only enable PAM tests if the version of PAM is greater than 1.4 if(LIBPAM_HAVE_CONFDIR) list(APPEND tests test_auth) endif() +#append tests depending on SSH/TLS +if(ENABLE_SSH_TLS) + list(APPEND tests test_two_channels test_ks_ts test_ec + test_ed25519 test_replace test_endpt_share_clients test_tls test_crl test_ch + test_runtime_changes test_client_ssh test_client_tls) +endif() + +foreach(src IN LISTS libsrc) + list(APPEND test_srcs "../${src}") +endforeach() +add_library(testobj OBJECT ${test_srcs} ${compatsrc}) + # add -Wl,--wrap flags set(test test_client_ssh) set(${test}_mock_funcs connect ssh_connect ssh_userauth_none ssh_userauth_kbdint ssh_is_connected @@ -34,18 +46,6 @@ foreach(mock_func IN LISTS ${test}_mock_funcs) set(${test}_wrap_link_flags "${${test}_wrap_link_flags},--wrap=${mock_func}") endforeach() -#append tests depending on SSH/TLS -if(ENABLE_SSH_TLS) - list(APPEND tests test_two_channels test_ks_ts test_ec - test_ed25519 test_replace test_endpt_share_clients test_tls test_crl test_ch - test_runtime_changes) -endif() - -foreach(src IN LISTS libsrc) - list(APPEND test_srcs "../${src}") -endforeach() -add_library(testobj OBJECT ${test_srcs} ${compatsrc}) - foreach(test_name IN LISTS tests) add_executable(${test_name} $ ${test_name}.c) target_link_libraries(${test_name} ${CMOCKA_LIBRARIES} ${LIBYANG_LIBRARIES} netconf2)