Revive code coverage
cc: @endJunction @basakz
Code coverage with fastcov.
Tests the testrunner
and ctests with a RUNTIME
< 5, see example report. The CI-job takes about 10 minutes on envinf2
.
Also, currently excludes:
- a long running test (
GeoLib.SearchNearestPointsInDenseGrid
) -
MeshLibMappedPropertyVector.Double|Int
because of segfault - ctest
Vtu2Grid
because of segfault
Added new CMake option OGS_CTEST_MAX_RUNTIME
to disable ctests with a higher RUNTIME
.
Usage:
cmake -S . --preset=coverage
cd build/coverage
ninja testrunner_coverage
# Open testrunner_coverage/index.html
ninja ctest_coverage
# Open ctest_coverage/index.html
A combined report can then be generated with:
[poetry run] fastcov -C testrunner_coverage.info ctest_coverage.info --lcov -o coverage.info
genhtml --demangle-cpp -o coverage_report coverage.info
# Open coverage_report/index.html
Will enable test coverage visualization for MRs once merged.
-
Feature description was added to the changelog -
Tests covering your feature were added? -
Any new feature or behavior change was documented?