Skip to content

Revive code coverage

Lars Bilke requested to merge bilke/ogs:coverage into master

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.

  1. Feature description was added to the changelog
  2. Tests covering your feature were added?
  3. Any new feature or behavior change was documented?
Edited by Lars Bilke

Merge request reports