aboutsummaryrefslogtreecommitdiff
path: root/tests/server/CMakeLists.txt
blob: 9430fd23b5e9ad644bb011f3ce1fe415d3daf42d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
project(servertests C)

if (WITH_SERVER AND UNIX AND NOT WIN32)

find_package(socket_wrapper)

add_subdirectory(test_server)

set(LIBSSH_SERVER_TESTS
    torture_server
)

include_directories(
  ${LIBSSH_PUBLIC_INCLUDE_DIRS}
  ${CMAKE_BINARY_DIR}
  test_server
)

if (ARGP_INCLUDE_DIR)
    include_directories(${ARGP_INCLUDE_DIR})
endif ()

foreach(_SRV_TEST ${LIBSSH_SERVER_TESTS})
    add_cmocka_test(${_SRV_TEST}
                    SOURCES ${_SRV_TEST}.c
                    COMPILE_OPTIONS ${DEFAULT_C_COMPILE_FLAGS}
                    LINK_LIBRARIES ${TORTURE_LIBRARY} testserver util
    )

    if (OSX)
        set_property(
            TEST
                ${_SRV_TEST}
            PROPERTY
            ENVIRONMENT DYLD_FORCE_FLAT_NAMESPACE=1;DYLD_INSERT_LIBRARIES=${SOCKET_WRAPPER_LIBRARY})
    else ()
        set_property(
            TEST
                ${_SRV_TEST}
            PROPERTY
                ENVIRONMENT ${TORTURE_ENVIRONMENT})
    endif()
endforeach()

endif (WITH_SERVER AND UNIX AND NOT WIN32)