xo-unit: build: streamline using xo_utest_coverage_config2()

This commit is contained in:
Roland Conybeare 2024-04-27 08:00:54 -04:00
commit d09157ce83
2 changed files with 1 additions and 39 deletions

View file

@ -7,3 +7,4 @@ xo_docdir_sphinx_config(
quantity-reference.rst quantity-class.rst quantity-factoryfunctions.rst quantity-unitvars.rst
unit-reference.rst unit-concept.rst unit-quantities.rst
)
xo_utest_coverage_config2()

View file

@ -8,45 +8,6 @@ set(SELF_SOURCE_FILES
xo_add_utest_executable(${SELF_EXECUTABLE_NAME} ${SELF_SOURCE_FILES})
# ----------------------------------------------------------------
# in coverage build, target to build+install coverage report
if (XO_SUBMODULE_BUILD)
# in submodule build, generate aggregate coverage report
# for all xo libraries
else()
set(CCOV_OUTPUT_DIR ${PROJECT_BINARY_DIR}/ccov/html)
set(CCOV_INDEX_FILE ${CCOV_OUTPUT_DIR}/index.html)
set(CCOV_REPORT_EXE ${PROJECT_BINARY_DIR}/gen-ccov)
# CMAKE_INSTALL_DOCDIR
# =default=> DATAROOTDIR/doc/PROJECT_NAME
# =default=> CMAKE_INSTALL_PREFIX/share/doc/xo_flatstring
set(CCOV_INSTALL_DOCDIR ${CMAKE_INSTALL_DOCDIR}/ccov)
# 'test' target should always be out-of-date
#
# DEPENDS: reminder - can't put 'test' here, requires 'all' target
#
add_custom_command(
OUTPUT ${CCOV_INDEX_FILE}
DEPENDS ${SELF_EXE}
COMMAND ${CCOV_REPORT_EXE}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMENT "Generating coverage report -> [${CCOV_OUTPUT_DIR}]")
add_custom_target(
ccov
DEPENDS ${CCOV_INDEX_FILE} ${SELF_EXE})
# OPTIONAL: quietly skip this step if ccov report not generated
install(
DIRECTORY ${CCOV_OUTPUT_DIR}
FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
DESTINATION ${CCOV_INSTALL_DOCDIR}
COMPONENT Documentation
OPTIONAL)
endif()
# ----------------------------------------------------------------
# dependencies..