Files
obs-streamer-tools-plugin/core/tests/CMakeLists.txt
T

29 lines
1.2 KiB
CMake
Raw Normal View History

# Dependency-free CTest targets (see test_util.h for why there is no gtest).
function(stplugin_add_test name)
add_executable(${name} ${name}.cpp)
target_link_libraries(${name} PRIVATE stplugin_core)
target_include_directories(${name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
if(WIN32)
# loopback_server.h needs Winsock for the real-backend tests.
target_link_libraries(${name} PRIVATE ws2_32)
endif()
add_test(NAME ${name} COMMAND ${name})
# Nothing here should ever take a minute; a hang is a failure, not a
# reason for CI to sit for its default 1500s.
set_tests_properties(${name} PROPERTIES TIMEOUT 120)
endfunction()
stplugin_add_test(test_core)
stplugin_add_test(test_json)
stplugin_add_test(test_api_client)
# Smoke test for the LiveKit SDK link: initialize()/shutdown() must succeed
# in-process. This is the cheapest possible proof that LiveKit::livekit is
# not just linked but loadable and callable (it dlopen-chains into
# liblivekit_ffi, which is where a broken RPATH would show up).
stplugin_add_test(test_livekit_smoke)
target_compile_definitions(test_livekit_smoke PRIVATE
STPLUGIN_EXPECTED_LIVEKIT_VERSION="${LIVEKIT_SDK_VERSION_RESOLVED}"
)