Parcourir la source

Coverage generation removed.

main
offa il y a 6 ans
Parent
révision
f66f000e50
2 fichiers modifiés avec 0 ajouts et 63 suppressions
  1. +0
    -6
      CMakeLists.txt
  2. +0
    -57
      cmake/Coverage.cmake

+ 0
- 6
CMakeLists.txt Voir le fichier

@@ -5,8 +5,6 @@ message(STATUS "~~~ ${PROJECT_NAME} v${PROJECT_VERSION} ~~~")

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
option(UNITTEST "Build Unit Tests" ON)
option(COVERAGE "Enable Coverage" OFF)
message(STATUS "Coverage : ${COVERAGE}")
option(ENABLE_COMPAT_HEADER "Enable compatible header 'scope'" OFF)
message(STATUS "Compatible Header : ${ENABLE_COMPAT_HEADER}")

@@ -18,10 +16,6 @@ else()
endif()


if( COVERAGE )
include(Coverage)
endif()


add_compile_options(-Wall
-Wextra

+ 0
- 57
cmake/Coverage.cmake Voir le fichier

@@ -1,57 +0,0 @@

# Find Lcov tools
find_program(LCOV lcov DOC "LCov")
find_program(LCOV_GENHTML genhtml DOC "LCov GenHtml" HINTS ${LCOV}/..)

if( NOT LCOV OR NOT LCOV_GENHTML )
message(SEND_ERROR "LCov tools not found")
endif()


# Files and folders
set(COV_DIR "${CMAKE_BINARY_DIR}/coverage")
set(COV_FILE "${COV_DIR}/${PROJECT_NAME}.info")

if( NOT EXISTS ${COV_DIR} )
file(MAKE_DIRECTORY ${COV_DIR})
endif()


# Compiler flags
set(flag --coverage)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")


set(INPUT_DIR "${CMAKE_SOURCE_DIR}")

# Make targets
add_custom_target(coverage-clean ${CMAKE_COMMAND} -E make_directory ${COV_DIR}
COMMAND ${LCOV}
--directory ${INPUT_DIR}
--zerocounters

WORKING_DIRECTORY ${COV_DIR}
COMMENT "Zerocounter coverage data"
VERBATIM
)

add_custom_target(coverage ${CMAKE_COMMAND} -E make_directory ${COV_DIR}
COMMAND ${LCOV}
--capture
--directory ${INPUT_DIR}
--output-file ${COV_FILE}
--no-external

COMMAND ${LCOV}
--remove ${COV_FILE} "*/test/*"
--remove ${COV_FILE} "*/generated/*"
--output-file ${COV_FILE}

COMMAND ${LCOV_GENHTML} --legend ${COV_FILE}

WORKING_DIRECTORY ${COV_DIR}
COMMENT "Generate coverage data"
VERBATIM
)


Chargement…
Annuler
Enregistrer