Skip to content

Commit

Permalink
fix cmake command
Browse files Browse the repository at this point in the history
  • Loading branch information
joergbrech committed Jan 21, 2025
1 parent 7cf7b67 commit 9528604
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions cmake/CodeCoverage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,19 @@ FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _testdir _outputname)
COMMAND ${LCOV_PATH} --directory ../.. --capture --ignore-errors mismatch --output-file ${_outputname}_all.info
COMMAND ${LCOV_PATH} --remove ${_outputname}_all.info '${PROJECT_SOURCE_DIR}/${_testdir}/*' '${PROJECT_SOURCE_DIR}/tests/common/*' '${PROJECT_SOURCE_DIR}/thirdparty/**' '/usr/*' '*oce*' '*build*' '*tixi3*' '${PROJECT_SOURCE_DIR}/src/generated/*' --output-file ${_outputname}.info

IF(TIGL_COVERAGE_GENHTML)
COMMAND ${GENHTML_PATH} -o ../../${_outputname} ${_outputname}.info
ENDIF()

COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}_all.info

USES_TERMINAL
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${_testdir}
COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
)

# Show info where to find the report
ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD
COMMAND ;
COMMENT "Open ./${_outputname}/index.html in your browser to view the coverage report."
)
IF(TIGL_COVERAGE_GENHTML)
ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD
COMMAND ${GENHTML_PATH} -o ../../${_outputname} ${_outputname}.info
COMMENT "Generating HTML report. Open ./${_outputname}/index.html in your browser to view the coverage report."
)
ENDIF()

ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE

Expand Down

0 comments on commit 9528604

Please sign in to comment.