mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 04:02:15 +02:00
abd1c5b208
Removed declared_size_defined in favor of just setting declared_size to a special value (SIZE_UNDEF) when it's undefined. Signed-off-by: James Yonan <james@openvpn.net>
73 lines
1.9 KiB
CMake
73 lines
1.9 KiB
CMake
include(dlgoogletest)
|
|
|
|
# Extra includes/libraries that are currently only use by the core unit test
|
|
FIND_PATH(LZO_INCLUDE_DIR NAMES lzo/lzo1x.h)
|
|
FIND_LIBRARY(LZO_LIBRARIES NAMES lzo2)
|
|
|
|
if (LZO_INCLUDE_DIR AND LZO_LIBRARIES)
|
|
list(APPEND CORE_TEST_DEFINES -DHAVE_LZO)
|
|
list(APPEND EXTRA_LIBS ${LZO_LIBRARIES})
|
|
list(APPEND EXTRA_INCLUDES ${LZO_INCLUDE_DIR})
|
|
message("lzo found, running lzo compression tests")
|
|
else ()
|
|
message("lzo not found, skipping lzo compression tests")
|
|
endif ()
|
|
|
|
|
|
|
|
set(CORE_TEST_DEFINES
|
|
-DOPENVPN_FORCE_TUN_NULL
|
|
-DUNIT_TEST
|
|
-DUNITTEST_SOURCE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/\"
|
|
)
|
|
|
|
add_executable(coreUnitTests
|
|
core_tests.cpp
|
|
test_route_emulation.cpp
|
|
test_log.cpp
|
|
test_comp.cpp
|
|
test_b64.cpp
|
|
test_verify_x509_name.cpp
|
|
test_ssl.cpp
|
|
test_continuation.cpp
|
|
test_optfilt.cpp
|
|
test_pktstream.cpp
|
|
test_remotelist.cpp
|
|
test_http_proxy.cpp
|
|
test_peer_fingerprint.cpp
|
|
)
|
|
|
|
if (${USE_MBEDTLS})
|
|
target_sources(coreUnitTests PRIVATE
|
|
test_mbedtls_x509certinfo.cpp
|
|
)
|
|
else ()
|
|
target_sources(coreUnitTests PRIVATE
|
|
test_openssl_x509certinfo.cpp
|
|
)
|
|
endif ()
|
|
|
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
|
target_sources(coreUnitTests PRIVATE test_sitnl.cpp)
|
|
endif ()
|
|
|
|
if (UNIX)
|
|
target_sources(coreUnitTests PRIVATE test_cpu_time.cpp)
|
|
endif ()
|
|
|
|
if (WIN32)
|
|
target_sources(coreUnitTests PRIVATE test_iphelper.cpp)
|
|
endif ()
|
|
|
|
if (WIN32)
|
|
target_sources(coreUnitTests PRIVATE test_iphelper.cpp)
|
|
endif ()
|
|
|
|
add_core_dependencies(coreUnitTests)
|
|
target_link_libraries(coreUnitTests ${GTEST_LIB} ${EXTRA_LIBS})
|
|
|
|
target_compile_definitions(coreUnitTests PRIVATE ${CORE_TEST_DEFINES})
|
|
target_include_directories(coreUnitTests PRIVATE ${EXTRA_INCLUDES})
|
|
|
|
add_test(NAME CoreTests COMMAND coreUnitTests)
|