Skip to content

Commit

Permalink
add codecov test cmake option
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengjian526 committed Jan 21, 2024
1 parent bcca5ff commit ed72040
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmake/develop.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,13 @@ if (ENABLE_JAVA)
find_package(JNI REQUIRED)
message(STATUS "Use Java")
endif()

# coverage test
option(COVERAGE_TEST "Build with unit test coverage" OFF)
if(COVERAGE_TEST)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage --coverage")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-instr-generate -fcoverage-mapping")
endif()
endif()

0 comments on commit ed72040

Please sign in to comment.