From 8ccd2a732763206e5f233fd3368c4c1048586d6d Mon Sep 17 00:00:00 2001 From: Gereon Kremer Date: Wed, 9 Mar 2022 00:19:36 +0100 Subject: [PATCH] Produce intermediate json output for coverage (#8252) This splits the generation of coverage information into two steps, generating an intermediate json file. This allows further tooling to used this json information: we plan to check whether the APIs (and their tests) are complete by looking at their code coverage within the cpp api. --- cmake/CodeCoverage.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmake/CodeCoverage.cmake b/cmake/CodeCoverage.cmake index c003d2cef..9c691f8f7 100644 --- a/cmake/CodeCoverage.cmake +++ b/cmake/CodeCoverage.cmake @@ -54,17 +54,24 @@ function(setup_code_coverage_fastcov) "Resetting code coverage counters to zero." ) - add_custom_target(${COVERAGE_NAME} + add_custom_target(${COVERAGE_NAME}-json COMMAND ${FASTCOV_BINARY} -d ${COVERAGE_PATH} ${EXCLUDES} -o coverage.json -j${FASTCOV_PARALLEL_JOBS} -X + DEPENDS + ${COVERAGE_DEPENDENCIES} + COMMENT + "Generate code coverage JSON report." + ) + + add_custom_target(${COVERAGE_NAME} COMMAND ${FASTCOV_BINARY} -C coverage.json --lcov -o coverage.info COMMAND ${GENHTML_BINARY} --demangle-cpp --no-prefix -o coverage coverage.info DEPENDS - ${COVERAGE_DEPENDENCIES} + coverage-json COMMENT "Generate code coverage report." ) -- 2.30.2