File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ endif()
197197# ccov-report : Generates HTML code coverage report for every target added with 'AUTO' parameter.
198198# ccov-${TARGET_NAME} : Generates HTML code coverage report.
199199# ccov-report-${TARGET_NAME} : Prints to command line summary per-file coverage information.
200+ # ccov-export-${TARGET_NAME} : Exports the coverage report to a JSON file.
200201# ccov-show-${TARGET_NAME} : Prints to command line detailed per-line coverage information.
201202# ccov-all : Generates HTML code coverage report, merging every target added with 'ALL' parameter into a single detailed report.
202203# ccov-all-report : Prints summary per-file coverage information for every target added with ALL' parameter to the command line.
@@ -359,6 +360,17 @@ function(target_code_coverage TARGET_NAME)
359360 ${EXCLUDE_REGEX}
360361 DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME} )
361362
363+ # Export coverage information so continuous integration tools (e.g.
364+ # Jenkins) can consume it
365+ add_custom_target (
366+ ccov-export-${target_code_coverage_COVERAGE_TARGET_NAME}
367+ COMMAND
368+ ${LLVM_COV_PATH} export $<TARGET_FILE:${TARGET_NAME} > ${SO_OBJECTS}
369+ -instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME} .profdata
370+ -format="text" ${EXCLUDE_REGEX} >
371+ ${CMAKE_COVERAGE_OUTPUT_DIRECTORY} /${target_code_coverage_COVERAGE_TARGET_NAME} .json
372+ DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME} )
373+
362374 # Generates HTML output of the coverage information for perusal
363375 add_custom_target (
364376 ccov-${target_code_coverage_COVERAGE_TARGET_NAME}
You can’t perform that action at this time.
0 commit comments