1 #------------------------------------------ 2 # Manage CamiTK Test coverage 3 #------------------------------------------- 5 # When using gcc, enable test coverage 6 # using https://github.com/bilke/cmake-modules/blob/master/CodeCoverage.cmake 7 # requires lcov to be installed on the machine 8 if(CMAKE_COMPILER_IS_GNUCXX)
10 option(CAMITK_TEST_COVERAGE
"Check this option to generate the 'camitk-ce-test-coverage' target that will create a coverage analysis report in ${PROJECT_BINARY_DIR}/camitk-ce-test-coverage" OFF)
12 if (CAMITK_TEST_COVERAGE)
13 # CodeCoverage is an additional CMake modules published on github by Lars Bilke. 14 # it declares append_coverage_compiler_flags and setup_target_for_coverage macros 17 # First append gxx flags, this has to be done before any C++ project configuration takes place 18 append_coverage_compiler_flags()
20 # Exclude the following files: 21 # - generated source file (in build dir) 22 # - installed library headers from coverage analysis 23 set(COVERAGE_EXCLUDES
'${PROJECT_BINARY_DIR}/*' 26 # Defines
a specific target to run test coverage and reporting.
27 # This will create
a specific
camitk-ce-test-coverage target
28 # that, when run, will launch all the test known by ctest in parallel
29 # and generate
a report in ${PROJECT_BINARY_DIR}/
camitk-ce-test-coverage
31 # Note: you can run a quick test by bypassing some tests. 32 # e.g., to run only one test every 50 tests "-I 1,,50" (ctest documenation: -I Start,End,Stride,test#,test# 33 # Note: add "-V" or "-VV" for verbose, add "-R pattern" to run only specific test 34 setup_target_for_coverage(NAME
camitk-ce-test-coverage
35 EXECUTABLE ctest --parallel 5)
if(CMAKE_COMPILER_IS_GNUCXX) option(CAMITK_TEST_COVERAGE "Check this option to generate the 'camitk-ce-test-coverage' target that will create a coverage analysis report in $
Definition: CamiTKTestCoverage.h:8
Definition: Action.cpp:36
cmake modules macros camitk test endif() add_custom_target(camitk-ce-iwyu COMMAND $
Definition: CamiTKIncludeWhatYouUse.h:37
static void include(QRect &r, const QRect &rect)
Definition: canvas_typed/qtcanvas.cpp:98