summaryrefslogtreecommitdiff
path: root/Tests/CTestTestMemcheck
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CTestTestMemcheck')
-rw-r--r--Tests/CTestTestMemcheck/CMakeLists.txt81
-rw-r--r--Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/DummyBC/test.cmake.in24
-rw-r--r--Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/DummyPurify/test.cmake.in24
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in24
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in26
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in26
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt6
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake9
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in24
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in27
-rw-r--r--Tests/CTestTestMemcheck/NotExist/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/NotExist/test.cmake.in18
-rw-r--r--Tests/CTestTestMemcheck/Unknown/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/Unknown/test.cmake.in18
-rw-r--r--Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in18
31 files changed, 433 insertions, 0 deletions
diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt
new file mode 100644
index 0000000..2730a61
--- /dev/null
+++ b/Tests/CTestTestMemcheck/CMakeLists.txt
@@ -0,0 +1,81 @@
+foreach (_retval 0 1)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret${_retval}.c" "int main(){return ${_retval};}\n")
+endforeach ()
+
+# create binaries that we will use as a pseudo memory checker
+add_executable(pseudo_valgrind "${CMAKE_CURRENT_BINARY_DIR}/ret0.c")
+set_target_properties(pseudo_valgrind PROPERTIES OUTPUT_NAME valgrind)
+
+# Xcode 2.x forgets to create the output directory before linking
+# the individual architectures.
+if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]")
+ add_custom_command(TARGET pseudo_valgrind
+ PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}"
+ )
+endif()
+
+add_executable(pseudo_purify "${CMAKE_CURRENT_BINARY_DIR}/ret0.c")
+set_target_properties(pseudo_purify PROPERTIES OUTPUT_NAME purify)
+add_executable(pseudo_BC "${CMAKE_CURRENT_BINARY_DIR}/ret0.c")
+set_target_properties(pseudo_BC PROPERTIES OUTPUT_NAME BC)
+
+# binary to be used as pre- and post-memcheck command that fails
+add_executable(memcheck_fail "${CMAKE_CURRENT_BINARY_DIR}/ret1.c")
+
+foreach (_test IN ITEMS Unknown UnknownQuoted NotExist
+ DummyValgrind DummyValgrindPrePost
+ DummyValgrindFailPre DummyValgrindFailPost
+ DummyPurify DummyBC
+ DummyValgrindIgnoreMemcheck)
+ configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/${_test}/test.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/${_test}/test.cmake"
+ @ONLY ESCAPE_QUOTES)
+ add_test(NAME CTestTestMemcheck${_test}
+ COMMAND ${CMAKE_CTEST_COMMAND}
+ -S "${CMAKE_CURRENT_BINARY_DIR}/${_test}/test.cmake" -V
+ --output-log "${CMAKE_CURRENT_BINARY_DIR}/${_test}/testOutput.log"
+ -D PSEUDO_BC=$<TARGET_FILE:pseudo_BC>
+ -D PSEUDO_PURIFY=$<TARGET_FILE:pseudo_purify>
+ -D PSEUDO_VALGRIND=$<TARGET_FILE:pseudo_valgrind>
+ -D ERROR_COMMAND=$<TARGET_FILE:memcheck_fail>
+ )
+endforeach ()
+
+string(REPLACE "\\" "\\\\" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND}")
+string(REPLACE "(" "\\(" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}")
+string(REPLACE ")" "\\)" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}")
+string(REPLACE "+" "\\+" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}")
+
+foreach (_unkn Unknown UnknownQuoted)
+ set_tests_properties(CTestTestMemcheck${_unkn} PROPERTIES
+ PASS_REGULAR_EXPRESSION "Do not understand memory checker: ${CMAKE_COMMAND_ESCAPED}\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/${_unkn}/test.cmake\n")
+endforeach ()
+
+set_tests_properties(CTestTestMemcheckNotExist PROPERTIES
+ PASS_REGULAR_EXPRESSION "Memory checker \\(MemoryCheckCommand\\) not set, or cannot find the specified program.")
+
+set(NORMAL_CTEST_OUTPUT "\n-- Processing memory checking output: \nMemory checking results:\n(BullseyeCoverage[^\n]*\n)?")
+
+# It is a valid result if valgrind does not output any files (can e.g. happen
+# if you have not compiled in debug mode), so these tests will not fail.
+set_tests_properties(CTestTestMemcheckDummyValgrind CTestTestMemcheckDummyValgrindPrePost
+ PROPERTIES
+ PASS_REGULAR_EXPRESSION "${NORMAL_CTEST_OUTPUT}")
+
+foreach (_pp Pre Post)
+ string(TOLOWER ${_pp} _pp_lower)
+ set_tests_properties(CTestTestMemcheckDummyValgrindFail${_pp}
+ PROPERTIES
+ PASS_REGULAR_EXPRESSION "\nProblem running command: ${CMAKE_CURRENT_BINARY_DIR}[^\n]*fail[^\n]*\n(.*\n)?Problem executing ${_pp_lower}-memcheck command\\(s\\\).\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyValgrindFail${_pp}/test.cmake\n")
+endforeach ()
+
+set_tests_properties(CTestTestMemcheckDummyValgrindIgnoreMemcheck
+ PROPERTIES
+ PASS_REGULAR_EXPRESSION "\n2/2 Test #2: RunCMakeAgain .*\n1/1 MemCheck #1: RunCMake .*${NORMAL_CTEST_OUTPUT}")
+
+set_tests_properties(CTestTestMemcheckDummyPurify PROPERTIES
+ PASS_REGULAR_EXPRESSION "\nCannot find memory tester output file: ${CMAKE_CURRENT_BINARY_DIR}/DummyPurify/Testing/Temporary/MemoryChecker.log\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyPurify/test.cmake\n")
+
+set_tests_properties(CTestTestMemcheckDummyBC PROPERTIES
+ PASS_REGULAR_EXPRESSION "\nCannot find memory tester output file: ${CMAKE_CURRENT_BINARY_DIR}/DummyBC/Testing/Temporary/MemoryChecker.log\n(.*\n)?Error parsing XML in stream at line 1: no element found\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyBC/test.cmake\n")
diff --git a/Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt
new file mode 100644
index 0000000..aa0e495
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckDummyBC)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake
new file mode 100644
index 0000000..39cdd88
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyBC")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/DummyBC/test.cmake.in b/Tests/CTestTestMemcheck/DummyBC/test.cmake.in
new file mode 100644
index 0000000..5005498
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyBC/test.cmake.in
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyBC")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyBC")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyBC")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_BC}")
+
+#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt
new file mode 100644
index 0000000..dfd93fd
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckDummyPurify)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake
new file mode 100644
index 0000000..40b9608
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyPurify")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/DummyPurify/test.cmake.in b/Tests/CTestTestMemcheck/DummyPurify/test.cmake.in
new file mode 100644
index 0000000..0df4f68
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyPurify/test.cmake.in
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyPurify")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyPurify")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyPurify")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_PURIFY}")
+
+#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt
new file mode 100644
index 0000000..822966a
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckDummyValgrind)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake
new file mode 100644
index 0000000..4ca59a4
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrind")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in
new file mode 100644
index 0000000..e341fed
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrind")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrind")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrind")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}")
+
+#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt
new file mode 100644
index 0000000..8185071
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckDummyValgrindFailPost)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake
new file mode 100644
index 0000000..4ca59a4
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrind")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in
new file mode 100644
index 0000000..7c1aa66
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in
@@ -0,0 +1,26 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindFailPost")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindFailPost")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindFailPost")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}")
+
+set(CTEST_CUSTOM_POST_MEMCHECK "${ERROR_COMMAND}")
+
+#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt
new file mode 100644
index 0000000..3714cd6
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckDummyValgrindFailPre)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake
new file mode 100644
index 0000000..4ca59a4
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrind")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in
new file mode 100644
index 0000000..b2d7bb1
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in
@@ -0,0 +1,26 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindFailPre")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindFailPre")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindFailPre")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}")
+
+set(CTEST_CUSTOM_PRE_MEMCHECK "${ERROR_COMMAND}")
+
+#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt
new file mode 100644
index 0000000..5d437d1
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckDummyValgrindIgnoreMemcheck)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
+add_test (RunCMakeAgain "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake
new file mode 100644
index 0000000..6eee3e6
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake
@@ -0,0 +1,9 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrindIgnoreMemcheck")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
+
+set(CTEST_CUSTOM_MEMCHECK_IGNORE RunCMakeAgain)
diff --git a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in
new file mode 100644
index 0000000..031a232
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindIgnoreMemcheck")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindIgnoreMemcheck")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindIgnoreMemcheck")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}")
+
+#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt
new file mode 100644
index 0000000..bc15632
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckDummyValgrindPrePost)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake
new file mode 100644
index 0000000..6e4c2e8
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrindPrePost")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in
new file mode 100644
index 0000000..44c416e
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in
@@ -0,0 +1,27 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindPrePost")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindPrePost")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindPrePost")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}")
+
+set(CTEST_CUSTOM_PRE_MEMCHECK "${CTEST_MEMORYCHECK_COMMAND}")
+set(CTEST_CUSTOM_POST_MEMCHECK "${CTEST_MEMORYCHECK_COMMAND}")
+
+#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/NotExist/CMakeLists.txt b/Tests/CTestTestMemcheck/NotExist/CMakeLists.txt
new file mode 100644
index 0000000..4d905de
--- /dev/null
+++ b/Tests/CTestTestMemcheck/NotExist/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckNotExist)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake b/Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake
new file mode 100644
index 0000000..3ed84aa
--- /dev/null
+++ b/Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckUnknown")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/NotExist/test.cmake.in b/Tests/CTestTestMemcheck/NotExist/test.cmake.in
new file mode 100644
index 0000000..78db7e2
--- /dev/null
+++ b/Tests/CTestTestMemcheck/NotExist/test.cmake.in
@@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckNotExist")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/NotExist")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/NotExist")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_MEMORYCHECK_COMMAND "${CTEST_BINARY_DIRECTORY}/no-memcheck-exe")
+
+CTEST_START(Experimental)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/Unknown/CMakeLists.txt b/Tests/CTestTestMemcheck/Unknown/CMakeLists.txt
new file mode 100644
index 0000000..3fd3103
--- /dev/null
+++ b/Tests/CTestTestMemcheck/Unknown/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckUnknown)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake b/Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake
new file mode 100644
index 0000000..3ed84aa
--- /dev/null
+++ b/Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckUnknown")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/Unknown/test.cmake.in b/Tests/CTestTestMemcheck/Unknown/test.cmake.in
new file mode 100644
index 0000000..c0b7839
--- /dev/null
+++ b/Tests/CTestTestMemcheck/Unknown/test.cmake.in
@@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckUnknown")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/Unknown")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/Unknown")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_MEMORYCHECK_COMMAND "@CMAKE_COMMAND@")
+
+CTEST_START(Experimental)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt b/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt
new file mode 100644
index 0000000..6f49c61
--- /dev/null
+++ b/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckUnknownQuoted)
+include(CTest)
+
+add_test (RunCMake "\"${CMAKE_COMMAND}\"")
diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake b/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake
new file mode 100644
index 0000000..f0233a7
--- /dev/null
+++ b/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckUnknownQuoted")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in b/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in
new file mode 100644
index 0000000..e2bfb60
--- /dev/null
+++ b/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in
@@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckUnknownQuoted")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/UnknownQuoted")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/UnknownQuoted")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_MEMORYCHECK_COMMAND "@CMAKE_COMMAND@")
+
+CTEST_START(Experimental)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)