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.
"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."
)