Skip to content

Commit 8b3891f

Browse files
kartbennashif
authored andcommitted
doc: add doxygen-coverage target
This makes it easier for anyone to get a coverage report for the doxygen documentation through a simple "make doxygen-coverage". Signed-off-by: Benjamin Cabé <[email protected]>
1 parent 49157ea commit 8b3891f

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

doc/CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,27 @@ set_target_properties(
118118
ADDITIONAL_CLEAN_FILES "${DOXY_OUT}"
119119
)
120120

121+
#-------------------------------------------------------------------------------
122+
# Doxygen Coverage
123+
124+
add_custom_target(
125+
doxygen-coverage
126+
COMMAND ${PYTHON_EXECUTABLE} -m coverxygen
127+
--xml-dir ${CMAKE_CURRENT_BINARY_DIR}/doxygen/xml/
128+
--src-dir ${ZEPHYR_BASE}/include/
129+
--output ${CMAKE_CURRENT_BINARY_DIR}/doc-coverage.info
130+
COMMAND lcov
131+
--remove ${CMAKE_CURRENT_BINARY_DIR}/doc-coverage.info "*/deprecated"
132+
> ${CMAKE_CURRENT_BINARY_DIR}/new.info
133+
COMMAND genhtml
134+
--no-function-coverage
135+
--no-branch-coverage
136+
${CMAKE_CURRENT_BINARY_DIR}/new.info
137+
-o ${CMAKE_CURRENT_BINARY_DIR}/coverage-report
138+
DEPENDS doxygen
139+
COMMENT "Generating Doxygen coverage info and HTML report..."
140+
)
141+
121142
#-------------------------------------------------------------------------------
122143
# devicetree
123144

doc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ HW_FEATURES_VENDOR_FILTER ?=
1414
# ------------------------------------------------------------------------------
1515
# Documentation targets
1616

17-
.PHONY: configure clean html html-fast html-live html-live-fast latex pdf doxygen
17+
.PHONY: configure clean html html-fast html-live html-live-fast latex pdf doxygen doxygen-coverage
1818

1919
html-fast:
2020
${MAKE} html DT_TURBO_MODE=1 HW_FEATURES_TURBO_MODE=1
2121

2222
html-live-fast:
2323
${MAKE} html-live DT_TURBO_MODE=1 HW_FEATURES_TURBO_MODE=1
2424

25-
html html-live latex pdf linkcheck doxygen: configure
25+
html html-live latex pdf linkcheck doxygen doxygen-coverage: configure
2626
cmake --build ${BUILDDIR} --target $@
2727

2828
configure:

0 commit comments

Comments
 (0)