mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-02-04 00:49:08 +00:00
chore(build): add coverage target
This commit is contained in:
parent
b8404260b1
commit
104f18a82a
5 changed files with 789 additions and 1 deletions
|
|
@ -18,7 +18,12 @@ project(storm)
|
|||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
include(lib/system/cmake/system.cmake)
|
||||
list(APPEND CMAKE_MODULE_PATH
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/system/cmake"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/cmake-modules"
|
||||
)
|
||||
|
||||
include(system)
|
||||
|
||||
# OS defines
|
||||
if(WHOA_SYSTEM_WIN)
|
||||
|
|
@ -30,5 +35,27 @@ if(WHOA_SYSTEM_WIN)
|
|||
endif()
|
||||
|
||||
add_subdirectory(lib)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
# Running coverage on linux+gcc:
|
||||
#
|
||||
# sudo apt install lcov
|
||||
# cmake -DCMAKE_BUILD_TYPE=Debug ..
|
||||
# make
|
||||
# make StormCoverage
|
||||
#
|
||||
# Results in `StormCoverage/index.html`
|
||||
include(CodeCoverage)
|
||||
|
||||
setup_target_for_coverage_lcov(
|
||||
NAME StormCoverage
|
||||
EXECUTABLE StormTest
|
||||
DEPENDENCIES StormTest storm
|
||||
BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/storm"
|
||||
LCOV_ARGS --rc branch_coverage=1
|
||||
GENHTML_ARGS --rc genhtml_branch_coverage=1
|
||||
)
|
||||
endif()
|
||||
|
||||
add_subdirectory(storm)
|
||||
add_subdirectory(test)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue