mono-cpp/tests/CMakeLists.txt
2026-02-18 11:42:14 +01:00

30 lines
1.3 KiB
CMake

# ── Test targets ──────────────────────────────────────────────────────────────
include(CTest)
include(Catch)
# Unit tests — one per package
add_executable(test_logger unit/test_logger.cpp)
target_link_libraries(test_logger PRIVATE Catch2::Catch2WithMain logger)
catch_discover_tests(test_logger)
add_executable(test_html unit/test_html.cpp)
target_link_libraries(test_html PRIVATE Catch2::Catch2WithMain html)
catch_discover_tests(test_html)
add_executable(test_postgres unit/test_postgres.cpp)
target_link_libraries(test_postgres PRIVATE Catch2::Catch2WithMain postgres)
catch_discover_tests(test_postgres)
add_executable(test_json unit/test_json.cpp)
target_link_libraries(test_json PRIVATE Catch2::Catch2WithMain json)
catch_discover_tests(test_json)
add_executable(test_http unit/test_http.cpp)
target_link_libraries(test_http PRIVATE Catch2::Catch2WithMain http)
catch_discover_tests(test_http)
# Functional test — end-to-end CLI
add_executable(test_functional functional/test_cli.cpp)
target_link_libraries(test_functional PRIVATE Catch2::Catch2WithMain CLI11::CLI11 tomlplusplus::tomlplusplus logger html postgres http json)
catch_discover_tests(test_functional)