# ── 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}) add_executable(test_ipc unit/test_ipc.cpp) target_link_libraries(test_ipc PRIVATE Catch2::Catch2WithMain ipc) catch_discover_tests(test_ipc) add_executable(test_geo unit/test_geo.cpp) target_link_libraries(test_geo PRIVATE Catch2::Catch2WithMain geo) catch_discover_tests(test_geo) add_executable(test_gadm_reader unit/test_gadm_reader.cpp) target_link_libraries(test_gadm_reader PRIVATE Catch2::Catch2WithMain gadm_reader) catch_discover_tests(test_gadm_reader WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) add_executable(test_grid unit/test_grid.cpp) target_link_libraries(test_grid PRIVATE Catch2::Catch2WithMain grid) catch_discover_tests(test_grid WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) add_executable(test_search unit/test_search.cpp) target_link_libraries(test_search PRIVATE Catch2::Catch2WithMain search) catch_discover_tests(test_search WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})