Skip to content

Commit

Permalink
Merge pull request #140 from fktn-k/feature/fix_test_coverage_source_…
Browse files Browse the repository at this point in the history
…list

#128 fixed filtering source files to generate full-spec coverage
  • Loading branch information
fktn-k authored Oct 14, 2023
2 parents b8179b1 + fd36ee6 commit 1104a51
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/unit_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,15 @@ if(FK_YAML_CODE_COVERAGE)
target_link_libraries(${TEST_TARGET} PRIVATE --coverage)
endif()

file(GLOB_RECURSE SRC_FILES ${PROJECT_SOURCE_DIR}/include/fkYAML/*.hpp)

add_custom_target(
generate_test_coverage
COMMAND ${CMAKE_CTEST_COMMAND} -C ${CMAKE_BUILD_TYPE} --output-on-failure
COMMAND cd ${PROJECT_BINARY_DIR}/test/unit_test/CMakeFiles/${TEST_TARGET}.dir
COMMAND ${LCOV_TOOL} --directory . --capture --output-file ${PROJECT_NAME}.info --rc
lcov_branch_coverage=1
COMMAND ${LCOV_TOOL} -e ${PROJECT_NAME}.info ${PROJECT_SOURCE_DIR}/include/fkYAML/*.hpp
COMMAND ${LCOV_TOOL} -e ${PROJECT_NAME}.info ${SRC_FILES}
--output-file ${PROJECT_NAME}.info.filtered --rc lcov_branch_coverage=1
COMMAND ${CMAKE_SOURCE_DIR}/thirdparty/imapdl/filterbr.py ${PROJECT_NAME}.info.filtered >
${PROJECT_NAME}.info.filtered.noexcept
Expand Down

0 comments on commit 1104a51

Please sign in to comment.