Commit f1b7dfc3 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Enabled code coverage reports in cmake

parent 68c6fbc9
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ set( tnlVersion "0.1" )
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

include( OptimizeForArchitecture )
include( UseCodeCoverage )

####
# Settings for debug/release version
@@ -268,6 +267,10 @@ if( WITH_TESTS STREQUAL "yes" )
   if( GTEST_FOUND )
      set( CXX_TESTS_FLAGS "-DHAVE_GTEST" )
   endif( GTEST_FOUND )

   # enable code coverage reports
   set( ENABLE_CODECOVERAGE ON )
   include( UseCodeCoverage )
endif( WITH_TESTS STREQUAL "yes" )

find_package( PythonInterp 3 )
@@ -328,9 +331,6 @@ if( OPTIMIZED_VECTOR_HOST_OPERATIONS STREQUAL "yes" )
   AddCompilerFlag( "-DOPTIMIZED_VECTOR_HOST_OPERATIONS " )
endif()

set( CXX_TEST_FLAGS "-fprofile-arcs -ftest-coverage" )
set( LD_TEST_FLAGS "-lgcov -coverage" )

set( configDirectory \"${CMAKE_INSTALL_PREFIX}/share/tnl-${tnlVersion}/\")
set( sourceDirectory \"${PROJECT_SOURCE_DIR}/\" )
set( testsDirectory \"${PROJECT_TESTS_PATH}/\" )
+2 −2
Original line number Diff line number Diff line
@@ -26,6 +26,6 @@ if ( ENABLE_CODECOVERAGE )
        set( CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} --coverage )
        add_custom_target( coverage_init ALL ${CODECOV_LCOV} --base-directory .  --directory ${CMAKE_BINARY_DIR} --output-file ${CODECOV_OUTPUTFILE} --capture --initial )
        add_custom_target( coverage ${CODECOV_LCOV} --base-directory .  --directory ${CMAKE_BINARY_DIR} --output-file ${CODECOV_OUTPUTFILE} --capture COMMAND genhtml -o ${CODECOV_HTMLOUTPUTDIR} ${CODECOV_OUTPUTFILE} )
    endif ( CMAKE_COMPILER_IS_GNUCXX )
    endif ( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCXX )

endif (ENABLE_CODECOVERAGE )