diff --git a/cpp/CHANGELOG.md b/cpp/CHANGELOG.md index 01e065ed07..b50a7e90fc 100644 --- a/cpp/CHANGELOG.md +++ b/cpp/CHANGELOG.md @@ -92,7 +92,7 @@ Please mark all change in change log and use the ticket from JIRA. - MS-487 - Define metric type in CreateTable - MS-488 - Improve code format in scheduler - MS-495 - cmake: integrated knowhere -- MS-505 - Install core unit test +- MS-505 - Install core unit test and add to coverage ## New Feature - MS-343 - Implement ResourceMgr diff --git a/cpp/coverage.sh b/cpp/coverage.sh index 970394116e..701416921f 100755 --- a/cpp/coverage.sh +++ b/cpp/coverage.sh @@ -95,6 +95,7 @@ ${LCOV_CMD} -r "${FILE_INFO_OUTPUT}" -o "${FILE_INFO_OUTPUT_NEW}" \ "*/boost/*" \ "*/cmake_build/*_ep-prefix/*" \ "src/core/cmake_build*" \ + "src/core/thirdparty*" \ # gen html report ${LCOV_GEN_CMD} "${FILE_INFO_OUTPUT_NEW}" --output-directory ${DIR_LCOV_OUTPUT}/ \ No newline at end of file diff --git a/cpp/src/core/CMakeLists.txt b/cpp/src/core/CMakeLists.txt index 890c7ed4d1..d406f41ce3 100644 --- a/cpp/src/core/CMakeLists.txt +++ b/cpp/src/core/CMakeLists.txt @@ -72,6 +72,10 @@ include(ThirdPartyPackagesCore) add_subdirectory(src) +if (BUILD_COVERAGE STREQUAL "ON") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") +endif() + set(CORE_INCLUDE_DIRS ${CORE_INCLUDE_DIRS} PARENT_SCOPE) if(BUILD_UNIT_TEST STREQUAL "ON")