CTest: integrate example as optional test (PRIVATEBIN_IT-gated) and ensure DLL copy; wire example into root CMake

This commit is contained in:
mbusc
2025-08-28 15:44:16 +02:00
parent 0f58d40f52
commit df74c8a1af
3 changed files with 21 additions and 2 deletions

View File

@ -25,4 +25,13 @@ target_include_directories(test_basic PRIVATE
)
# Register the test with CTest
add_test(NAME test_basic COMMAND test_basic)
add_test(NAME test_basic COMMAND test_basic)
# Optional example run as a test (requires network and live server)
# Example-Test nur aktiv, wenn PRIVATEBIN_IT=1 gesetzt ist
add_test(NAME example_run COMMAND $<TARGET_FILE:example>)
if(DEFINED ENV{PRIVATEBIN_IT} AND NOT "$ENV{PRIVATEBIN_IT}" STREQUAL "0")
set_tests_properties(example_run PROPERTIES DISABLED FALSE)
else()
set_tests_properties(example_run PROPERTIES DISABLED TRUE)
endif()