Skip to content

Commit

Permalink
Merge pull request #259 from sandialabs/add_coverage
Browse files Browse the repository at this point in the history
Add code coverage with Compadre_COVERAGE CMake variable
  • Loading branch information
kuberry authored Nov 8, 2021
2 parents 052e79a + e98ed6d commit ad81de0
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 ad81de0

Please sign in to comment.