CTest/Coverage: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
(New page: ==Coverage With C++== ==Coverage With Python==)
 
Line 1: Line 1:
==Coverage With C++==
==Coverage With C++==
Currently coverage is only supported on gcc compiler. To perform coverage test, make sure that your code is build with debug symbols, without optimization, and with special flags. These flags are:
-fprofile-arcs -ftest-coverage
Also make sure to pass these flags to C compiler, CXX compiler, and the linker. For example:
CXXFLAGS="-g -O0 -Wall -W -Wshadow -Wunused-variable \
  -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers \
  -Wno-deprecated -Woverloaded-virtual -Wwrite-strings -fprofile-arcs -ftest-coverage"
CFLAGS="-g -O0 -Wall -W -fprofile-arcs -ftest-coverage"
LDFLAGS="-fprofile-arcs -ftest-coverage"


==Coverage With Python==
==Coverage With Python==

Revision as of 15:27, 25 April 2007

Coverage With C++

Currently coverage is only supported on gcc compiler. To perform coverage test, make sure that your code is build with debug symbols, without optimization, and with special flags. These flags are:

-fprofile-arcs -ftest-coverage

Also make sure to pass these flags to C compiler, CXX compiler, and the linker. For example:

CXXFLAGS="-g -O0 -Wall -W -Wshadow -Wunused-variable \
 -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers \
 -Wno-deprecated -Woverloaded-virtual -Wwrite-strings -fprofile-arcs -ftest-coverage"
CFLAGS="-g -O0 -Wall -W -fprofile-arcs -ftest-coverage"
LDFLAGS="-fprofile-arcs -ftest-coverage"

Coverage With Python