Enable coverage information generation and tracking
This MR enables the generation of code coverage reports for the source code. More specifically, it introduces the following changes:
- Adds the
gkfs-code-coverage.cmakeCMake script under{PROJECT_ROOT}/CMake/and includes it in the project's mainCMakeLists.txt. This script defines theGKFS_ENABLE_CODE_COVERAGEoption to control whether code coverage should be enabled when building, as well as thetarget_code_coverage()function to ensure that the appropriate flags are added to a CMake target. - Adds
gcovrto GekkoFS docker build image. - Adds a
coverage.shscript under{PROJECT_ROOT}/scripts/cithat provides both acaptureand amergework modes. This script abstracts away the direct usage ofgcovrand allows the appropriate generation of coverage reports when running tests in parallel in the CI. The script relies on a.coverage-exclusionsfile (also under{PROJECT_ROOT}/scripts/ci) to control which paths should be excluded from coverage reporting (e.g./usr/include/.*). - Adds a new
reportstage in the CI pipeline that upon completion generates artifacts both for a Cobertura XML and a HTML code coverage reports.
Edited by Alberto Miranda