</p>
+ <a name="memcheck"></a>
+ <h3>Running with valgrind</h3>
+
+ <p>
+ The testsuite can also be run using <a href="http://valgrind.org/">valgrind</a>
+ to check for <i>memory corruption</i> in the library.
+ </p>
+
+ <p>
+ You can do so by invoking
+ <pre>
+ ctest -DMEMORYCHECK=ON <...> -S ../tests/run_testsuite.cmake
+ </pre>
+ when running the testsuite, or directly by
+ <pre>
+ ctest <...> -S ../tests/run_memorycheck.cmake
+ </pre>
+ </p>
+
+ <p>
+ At the end of all of this, results will be shown in a separate section
+ "Dynamic Analysis" at the
+ <a href="http://cdash.kyomu.43-1.org/index.php?project=deal.II&display=project"
+ target="_top">deal.II cdash site</a>.
+ </p>
+
+
<a name="coverage"></a>
<h3>Generating coverage information</h3>
# CTEST_COVERAGE() stage will be run. Test results must go into the
# "Experimental" section.
#
+# MEMORYCHECK
+# - If set to ON the CTEST_MEMORYCHECK() stage will be run.
+# Test results must go into the "Experimantal" section.
+#
# MAKEOPTS
# - Additional options that will be passed directly to make (or ninja).
#
MESSAGE("-- COVERAGE: ${COVERAGE}")
+#
+# Setup memcheck:
+#
+
+IF(MEMORYCHECK)
+ IF(NOT TRACK MATCHES "Experimental")
+ MESSAGE(FATAL_ERROR "
+TRACK must be set to \"Experimental\" if Memcheck is enabled via
+MEMORYCHECK=TRUE.
+"
+ )
+ ENDIF()
+
+ FIND_PROGRAM(MEMORYCHECK_COMMAND NAMES valgrind)
+ IF(MEMORYCOMMAND MATCHES "-NOTFOUND")
+ MESSAGE(FATAL_ERROR "
+Memcheck enabled but could not find the valgrind executable. Please install
+valgrind.
+"
+ )
+ ENDIF()
+
+ SET(CTEST_MEMORYCHECK_COMMAND "${MEMORYCHECK_COMMAND}")
+ENDIF()
+
+MESSAGE("-- MEMORYCHECK: ${MEMORYCHECK}")
+
+
+
MACRO(CREATE_TARGETDIRECTORIES_TXT)
#
# It gets tricky: Fake a TargetDirectories.txt containing _all_ target
)
ENDIF()
- MESSAGE("-- Running CTEST_TESTS()")
IF(DEAL_II_MSVC)
SET(CTEST_BUILD_CONFIGURATION "${JOB_BUILD_CONFIGURATION}")
ENDIF()
- CTEST_TEST()
+ IF(MEMORYCHECK)
+ MESSAGE("-- Running CTEST_MEMCHECK()")
+ CTEST_MEMCHECK()
+ ELSE()
+ MESSAGE("-- Running CTEST_TESTS()")
+ CTEST_TEST()
+ ENDIF(MEMORYCHECK)
IF(COVERAGE)
CREATE_TARGETDIRECTORIES_TXT()