Skip to content

Commit

Permalink
Add CodeCoverage CMake file and Compadre_COVERAGE:BOOL CMake option
Browse files Browse the repository at this point in the history
  • Loading branch information
kuberry committed Nov 4, 2021
1 parent dd53bda commit e98ed6d
Show file tree
Hide file tree
Showing 3 changed files with 722 additions and 2 deletions.
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ else() # Raw CMake Project

bob_option(Compadre_TESTS "Compile Compadre tests" ON)
bob_option(Compadre_EXAMPLES "Compile Compadre examples" "${Compadre_TESTS}")
bob_option(Compadre_COVERAGE "Use code coverage" OFF)


endif()
Expand Down Expand Up @@ -459,7 +460,6 @@ else() # Raw CMake Project
bob_get_semver()
endif()


##########
#
#
Expand All @@ -468,6 +468,18 @@ else() # Raw CMake Project
#
##########

if (Compadre_COVERAGE)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(CodeCoverage)
append_coverage_compiler_flags()
setup_target_for_coverage_lcov(
NAME coverage
EXECUTABLE ctest
EXCLUDE "/Library/*" "${PROJECT_SOURCE_DIR}/kokkos/*"
"${PROJECT_SOURCE_DIR}/kokkos-kernels/*"
"${PROJECT_SOURCE_DIR}/pycompadre/*")
endif()


# compadre library
add_subdirectory(src)
Expand Down
Loading

0 comments on commit e98ed6d

Please sign in to comment.