mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2026-01-01 03:12:13 +08:00
feat(ci): add codecov test coverage support to master branch
Add CodeCov test coverage configuration: - Add LIBIPC_CODECOV option to CMakeLists.txt with coverage compilation flags - Add CodeCov badge to README.md for coverage status display Note: The codecov.yml workflow file needs to be added manually or requires workflows permission to push.
This commit is contained in:
parent
e38d3ed801
commit
3ca2e93b19
@ -5,6 +5,7 @@ option(LIBIPC_BUILD_TESTS "Build all of libipc's own tests."
|
||||
option(LIBIPC_BUILD_DEMOS "Build all of libipc's own demos." OFF)
|
||||
option(LIBIPC_BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
|
||||
option(LIBIPC_USE_STATIC_CRT "Set to ON to build with static CRT on Windows (/MT)." OFF)
|
||||
option(LIBIPC_CODECOV "Build with unit test coverage." OFF)
|
||||
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
@ -13,6 +14,12 @@ if(NOT MSVC)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
|
||||
endif()
|
||||
|
||||
# Code coverage support
|
||||
if (LIBIPC_CODECOV AND NOT MSVC)
|
||||
add_compile_options(--coverage)
|
||||
add_link_options(-lgcov --coverage)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
set(CompilerFlags
|
||||
CMAKE_CXX_FLAGS
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
[](https://github.com/mutouyun/cpp-ipc/blob/master/LICENSE)
|
||||
[](https://github.com/mutouyun/cpp-ipc/actions)
|
||||
[](https://codecov.io/github/mutouyun/cpp-ipc)
|
||||
[](https://ci.appveyor.com/project/mutouyun/cpp-ipc)
|
||||
[](https://github.com/microsoft/vcpkg/tree/master/ports/cpp-ipc)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user