# # cmake -C ${CONFIG_FILE}). This only has an effect if
# CTEST_BINARY_DIRECTORY is empty.
#
+# COVERAGE
+# - If set to TRUE deal.II will be configured with
+# DEAL_II_SETUP_COVERAGE=TRUE and the CTEST_COVERAGE() stage will
+# be run. Test results must go into the "Experimental" section
+#
# Furthermore, the following variables controlling the testsuite can be set
# and will be automatically handed down to cmake:
#
ENDIF()
ENDFOREACH()
+IF(COVERAGE)
+ LIST(APPEND _options "-DDEAL_II_SETUP_COVERAGE=TRUE")
+ LIST(APPEND _options "-DCMAKE_BUILD_TYPE=Debug")
+ENDIF()
+
#
# CTEST_BUILD_NAME:
#
${CTEST_BINARY_DIRECTORY}/include/deal.II/base/config.h
)
+#
+# Setup coverage:
+#
+IF(COVERAGE)
+ FIND_PROGRAM(GCOV_COMMAND NAMES gcov)
+
+ IF(GCOV_COMMAND MATCHES "-NOTFOUND")
+ MESSAGE(FATAL_ERROR "
+TRACK was set to \"Build Tests\" which requires the source directory to be
+under Subversion version control.
+"
+ )
+ ENDIF()
+
+ SET(CTEST_COVERAGE_COMMAND "${GCOV_COMMAND}")
+ENDIF()
+
########################################################################
# #
ENDIF()
CTEST_TEST()
+
+ IF(COVERAGE)
+ CTEST_COVERAGE()
+ ENDIF(COVERAGE)
+
ENDIF()
ENDIF()
# CMAKE_BUILD_TYPE
# DEAL_II_ALLOW_PLATFORM_INTROSPECTION
# DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS
+# DEAL_II_SETUP_COVERAGE
# BUILD_SHARED_LIBS
# DEAL_II_PREFER_STATIC_LIBS
# DEAL_II_STATIC_EXECUTABLE
)
MARK_AS_ADVANCED(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
+OPTION(DEAL_II_SETUP_COVERAGE
+ "Setup debug compiler flags to provide additional test coverage information. Currently only gprof is supported."
+ OFF
+ )
+MARK_AS_ADVANCED(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
+
SET(BUILD_SHARED_LIBS "ON" CACHE BOOL
"Build a shared library"
)
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-g")
ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS_DEBUG "-g")
ENDIF()
+
+ IF(DEAL_II_SETUP_COVERAGE)
+ #
+ # Enable test coverage
+ #
+ ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-ftest-coverage -fprofile-arcs")
+ ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS_DEBUG "-ftest-coverage -fprofile-arcs")
+ ENDIF()
+
ENDIF()
# "Configure sensible default CFLAGS and CXXFLAGS depending on platform, compiler and build target."
# )
#
+# SET(DEAL_II_SETUP_COVERAGE OFF CACHE BOOL
+# "Setup debug compiler flags to provide additional test coverage information. Currently only gprof is supported."
+# )
+#
# SET(CMAKE_CXX_COMPILER "" CACHE STRING
# "CXX Compiler."
# )
<code>DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS</code> to
<code>OFF</code>. Beware of the fact that certain features
may still pull in necessary compiler flags.
+
+ <li>
+ You can setup additional debug compiler flags to provide test
+ coverage information by setting
+ <code>DEAL_II_SETUP_COVERAGE</code> to <code>ON</code>.
</ol>
</p>