Merge branch 'lcov-report-ci'
All checks were successful
Chaos Ci / test-and-benchmark (push) Successful in 2m24s

Add coverage report generation to the CI workflow.
This commit is contained in:
hashlag
2026-01-28 23:15:42 +03:00
2 changed files with 20 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ jobs:
- name: Install
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake valgrind
sudo apt-get install -y build-essential cmake valgrind lcov
- name: Configure and build [Debug]
run: |
@@ -33,4 +33,17 @@ jobs:
run: valgrind --leak-check=full --track-origins=yes --show-leak-kinds=all ./build-debug/ChaosTests/ChaosTests
- name: Run benchmarks
run: ./build-release/ChaosBenches/ChaosBenches
run: ./build-release/ChaosBenches/ChaosBenches
- name: Process coverage data
run: |
lcov --exclude '*/usr/*' --exclude '*/_deps/*' --exclude '*/ChaosTests/*' -c -d build-debug/ -o lcovout
genhtml lcovout -o coverage-report
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: CoverageReport
path: coverage-report/
if-no-files-found: error
include-hidden-files: true

View File

@@ -26,6 +26,11 @@ target_include_directories(ChaosTests PRIVATE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/Chaos>
)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_options(ChaosTests PRIVATE --coverage)
target_link_options(ChaosTests PRIVATE --coverage)
endif()
include(GoogleTest)
gtest_discover_tests(ChaosTests)