From a0d6f4195e9a1ba77ab14b13575b891505109f5d Mon Sep 17 00:00:00 2001 From: Dany Petit Date: Sat, 29 Aug 2026 22:26:23 +0200 Subject: [PATCH] build(tests): make codecov coverage opt-in The codecov/FindGcov/FindLcov modules are fetched at configure time from a third-party server via CMakeCM. That breaks offline builds and adds an unnecessary supply-chain dependency for regular test runs. Coverage is now gated behind ENABLE_COVERAGE=ON. Default builds compile and run the Catch2 suite fully offline (verified: 53/53 pass). --- tests/CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c49768cfbd..d980c90cef 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,4 +1,10 @@ -include(codecov) +# Coverage tooling is opt-in: the codecov/FindGcov/FindLcov modules are fetched +# from a third-party server by CMakeCM, which breaks offline builds and adds a +# supply-chain dependency nobody needs for a regular test run. +option(ENABLE_COVERAGE "Enable code coverage instrumentation (downloads codecov cmake modules)" OFF) +if (ENABLE_COVERAGE) + include(codecov) +endif () set(TESTS_PROJECT_NAME Cytopia_Tests) @@ -114,5 +120,7 @@ set_target_properties( catch_discover_tests(${TESTS_PROJECT_NAME}) -add_coverage(${TESTS_PROJECT_NAME}) -coverage_evaluate() +if (ENABLE_COVERAGE) + add_coverage(${TESTS_PROJECT_NAME}) + coverage_evaluate() +endif ()