Debian Codegraph @

tests/client/CMakeLists.txt

raw
1 project(clienttests C)
2
3 find_package(socket_wrapper)
4
5 set(LIBSSH_CLIENT_TESTS
6 torture_algorithms
7 torture_auth
8 torture_auth_cert
9 torture_auth_agent_forwarding
10 torture_client_callbacks
11 torture_client_config
12 torture_connect
13 torture_hostkey
14 torture_rekey
15 torture_forward
16 torture_knownhosts
17 torture_knownhosts_verify
18 torture_proxycommand
19 torture_session
20 torture_request_env
21 torture_request_pty_modes
22 torture_client_global_requests
23 torture_get_kex_algo
24 )
25
26 find_program(SCP_EXECUTABLE NAMES scp)
27 if (SCP_EXECUTABLE)
28 set(LIBSSH_CLIENT_TESTS
29 ${LIBSSH_CLIENT_TESTS}
30 torture_scp)
31 endif()
32
33 if (WITH_PKCS11_URI)
34 set(LIBSSH_CLIENT_TESTS
35 ${LIBSSH_CLIENT_TESTS}
36 torture_auth_pkcs11)
37 endif()
38
39 if (HAVE_PTHREAD)
40 set(LIBSSH_CLIENT_TESTS
41 ${LIBSSH_CLIENT_TESTS}
42 torture_proxyjump)
43 endif()
44
45 if (WITH_GSSAPI AND GSSAPI_FOUND AND GSSAPI_TESTING)
46 set(LIBSSH_CLIENT_TESTS
47 ${LIBSSH_CLIENT_TESTS}
48 torture_gssapi_auth
49 torture_gssapi_key_exchange
50 torture_gssapi_key_exchange_null)
51 endif()
52
53 if (DEFAULT_C_NO_DEPRECATION_FLAGS)
54 set_source_files_properties(torture_knownhosts.c
55 PROPERTIES
56 COMPILE_FLAGS ${DEFAULT_C_NO_DEPRECATION_FLAGS})
57 endif()
58
59 if (WITH_SFTP)
60 if (WITH_BENCHMARKS)
61 set(SFTP_BENCHMARK_TESTS
62 torture_sftp_benchmark)
63 endif()
64 set(LIBSSH_CLIENT_TESTS
65 ${LIBSSH_CLIENT_TESTS}
66 torture_sftp_init
67 torture_sftp_ext
68 torture_sftp_canonicalize_path
69 torture_sftp_dir
70 torture_sftp_read
71 torture_sftp_fsync
72 torture_sftp_hardlink
73 torture_sftp_limits
74 torture_sftp_rename
75 torture_sftp_expand_path
76 torture_sftp_aio
77 torture_sftp_home_directory
78 torture_sftp_setstat
79 torture_sftp_packet_read
80 torture_sftp_recv_response_msg
81 torture_sftp_get_users_groups_by_id
82 ${SFTP_BENCHMARK_TESTS})
83 endif (WITH_SFTP)
84
85 set(TORTURE_CLIENT_ENVIRONMENT ${TORTURE_ENVIRONMENT})
86 list(APPEND TORTURE_CLIENT_ENVIRONMENT NSS_WRAPPER_HOSTS=${CMAKE_BINARY_DIR}/tests/etc/hosts)
87
88 foreach(_CLI_TEST ${LIBSSH_CLIENT_TESTS})
89 add_cmocka_test(${_CLI_TEST}
90 SOURCES ${_CLI_TEST}.c
91 COMPILE_OPTIONS ${DEFAULT_C_COMPILE_FLAGS}
92 LINK_LIBRARIES ${TORTURE_LIBRARY} util
93 )
94
95 if (OSX)
96 set_property(
97 TEST
98 ${_CLI_TEST}
99 PROPERTY
100 ENVIRONMENT DYLD_FORCE_FLAT_NAMESPACE=1;DYLD_INSERT_LIBRARIES=${SOCKET_WRAPPER_LIBRARY})
101 else ()
102 set_property(
103 TEST
104 ${_CLI_TEST}
105 PROPERTY
106 ENVIRONMENT ${TORTURE_CLIENT_ENVIRONMENT})
107 endif()
108 endforeach()