# ── 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) # E2E test — real Supabase connection (requires config/postgres.toml + network) add_executable(test_supabase e2e/test_supabase.cpp) target_link_libraries(test_supabase PRIVATE Catch2::Catch2WithMain tomlplusplus::tomlplusplus logger postgres json) catch_discover_tests(test_supabase WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) add_executable(test_polymech unit/test_polymech.cpp) target_link_libraries(test_polymech PRIVATE Catch2::Catch2WithMain polymech postgres) catch_discover_tests(test_polymech) # E2E test — polymech fetch_pages from live Supabase add_executable(test_polymech_e2e e2e/test_polymech_e2e.cpp) target_link_libraries(test_polymech_e2e PRIVATE Catch2::Catch2WithMain tomlplusplus::tomlplusplus logger postgres polymech json) catch_discover_tests(test_polymech_e2e WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})