dixx / Die_Chroniken_eines_namenlosen_Spiels

We develop a game just for the sake of learning how to do it. Okay, maybe it's more developing a game engine and using a game as its integration test. We have no real goal besides the learning experience.
Other
1 stars 1 forks source link

Code Coverage #131

Open dixx opened 4 years ago

dixx commented 4 years ago

This will help us to write only neccessary tests, and find out what we've missed.

Use gcov with cmake, like this:

if(CMAKE_COMPILER_IS_GNUCXX)
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
include(CodeCoverage)
APPEND_COVERAGE_COMPILER_FLAGS()
set(COVERAGE_LCOV_EXCLUDES 'dir1/*' 'dir2/*') // this is optional if you want to exclude some directory from the report
SETUP_TARGET_FOR_COVERAGE_LCOV(NAME foo_coverage EXECUTABLE foo DEPENDENCIES foo)
endif()

cmake module: https://github.com/bilke/cmake-modules/blob/master/CodeCoverage.cmake