From e0768cde3c687bde282e2378a64f6199f003e742 Mon Sep 17 00:00:00 2001 From: hashlag Date: Mon, 6 Jul 2026 02:44:37 +0300 Subject: [PATCH] Make coverage optional for debug builds by introducing CHAOS_COVERAGE flag. --- .gitea/workflows/ChaosCi.yaml | 2 +- ChaosTests/CMakeLists.txt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ChaosCi.yaml b/.gitea/workflows/ChaosCi.yaml index 7c33291..30b2826 100644 --- a/.gitea/workflows/ChaosCi.yaml +++ b/.gitea/workflows/ChaosCi.yaml @@ -20,7 +20,7 @@ jobs: - name: Configure and build tests [Debug] run: | mkdir build-debug - cmake -S . -B build-debug/ -D CMAKE_BUILD_TYPE=Debug + cmake -S . -B build-debug/ -D CMAKE_BUILD_TYPE=Debug -D CHAOS_COVERAGE=ON cmake --build build-debug/ -t ChaosTests - name: Configure and build benchmarks [Release] diff --git a/ChaosTests/CMakeLists.txt b/ChaosTests/CMakeLists.txt index 2345b8d..6afd10e 100644 --- a/ChaosTests/CMakeLists.txt +++ b/ChaosTests/CMakeLists.txt @@ -31,7 +31,9 @@ target_include_directories(ChaosTests PRIVATE target_compile_options(ChaosTests PRIVATE -Wunused -Werror=unused) -if(CMAKE_BUILD_TYPE STREQUAL "Debug") +option(CHAOS_COVERAGE "Enable coverage" OFF) + +if(CHAOS_COVERAGE) target_compile_options(ChaosTests PRIVATE --coverage) target_link_options(ChaosTests PRIVATE --coverage) endif()