summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/FortranCInterface.cmake6
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx173
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx5
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx2
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx5
-rw-r--r--Tests/CMakeLists.txt2
-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
38 files changed, 544 insertions, 84 deletions
diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake
index aafecb4..c59e1f8 100644
--- a/Modules/FortranCInterface.cmake
+++ b/Modules/FortranCInterface.cmake
@@ -61,7 +61,7 @@
# If the check fails and QUIET is not given the function terminates
# with a FATAL_ERROR message describing the problem. The purpose of
# this check is to stop a build early for incompatible compiler
-# combinations.
+# combinations. The test is built in the Release configuration.
#
# FortranCInterface is aware of possible GLOBAL and MODULE manglings
# for many Fortran compilers, but it also provides an interface to
@@ -250,6 +250,7 @@ function(FortranCInterface_VERIFY)
message(STATUS "${_desc}")
# Build a sample project which reports symbols.
+ set(CMAKE_TRY_COMPILE_CONFIGURATION Release)
try_compile(FortranCInterface_VERIFY_${lang}_COMPILED
${FortranCInterface_BINARY_DIR}/Verify${lang}
${FortranCInterface_SOURCE_DIR}/Verify
@@ -259,6 +260,9 @@ function(FortranCInterface_VERIFY)
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}"
"-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}"
"-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}"
+ "-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}"
+ "-DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}"
+ "-DCMAKE_Fortran_FLAGS_RELEASE:STRING=${CMAKE_Fortran_FLAGS_RELEASE}"
OUTPUT_VARIABLE _output)
file(WRITE "${FortranCInterface_BINARY_DIR}/Verify${lang}/output.txt" "${_output}")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 19d447e..6a0145b 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,5 @@
set(CMake_VERSION_MAJOR 2)
set(CMake_VERSION_MINOR 8)
set(CMake_VERSION_PATCH 9)
-set(CMake_VERSION_TWEAK 20121013)
+set(CMake_VERSION_TWEAK 20121017)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index a2a16d3..80218ad 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -247,7 +247,8 @@ void cmCTestMemCheckHandler::GenerateTestCommand(
{
std::vector<cmStdString>::size_type pp;
std::string memcheckcommand = "";
- memcheckcommand = this->MemoryTester;
+ memcheckcommand
+ = cmSystemTools::ConvertToOutputPath(this->MemoryTester.c_str());
for ( pp = 0; pp < this->MemoryTesterOptions.size(); pp ++ )
{
args.push_back(this->MemoryTesterOptions[pp]);
@@ -410,29 +411,46 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
"MemoryCheckCommand").c_str()) )
{
this->MemoryTester
- = cmSystemTools::ConvertToOutputPath(this->CTest->GetCTestConfiguration(
- "MemoryCheckCommand").c_str());
+ = this->CTest->GetCTestConfiguration("MemoryCheckCommand").c_str();
+
+ // determine the checker type
+ if ( this->MemoryTester.find("valgrind") != std::string::npos )
+ {
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::VALGRIND;
+ }
+ else if ( this->MemoryTester.find("purify") != std::string::npos )
+ {
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::PURIFY;
+ }
+ else if ( this->MemoryTester.find("BC") != std::string::npos )
+ {
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
+ }
+ else
+ {
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::UNKNOWN;
+ }
}
else if ( cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
"PurifyCommand").c_str()) )
{
this->MemoryTester
- = cmSystemTools::ConvertToOutputPath(this->CTest->GetCTestConfiguration(
- "PurifyCommand").c_str());
+ = this->CTest->GetCTestConfiguration("PurifyCommand").c_str();
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::PURIFY;
}
else if ( cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
"ValgrindCommand").c_str()) )
{
this->MemoryTester
- = cmSystemTools::ConvertToOutputPath(this->CTest->GetCTestConfiguration(
- "ValgrindCommand").c_str());
+ = this->CTest->GetCTestConfiguration("ValgrindCommand").c_str();
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::VALGRIND;
}
else if ( cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
"BoundsCheckerCommand").c_str()) )
{
this->MemoryTester
- = cmSystemTools::ConvertToOutputPath(this->CTest->GetCTestConfiguration(
- "BoundsCheckerCommand").c_str());
+ = this->CTest->GetCTestConfiguration("BoundsCheckerCommand").c_str();
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
}
else
{
@@ -470,82 +488,81 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
this->MemoryTesterOutputFile
= this->CTest->GetBinaryDir() + "/Testing/Temporary/MemoryChecker.log";
- if ( this->MemoryTester.find("valgrind") != std::string::npos )
+ switch ( this->MemoryTesterStyle )
{
- this->MemoryTesterStyle = cmCTestMemCheckHandler::VALGRIND;
- if ( this->MemoryTesterOptions.empty() )
- {
- this->MemoryTesterOptions.push_back("-q");
- this->MemoryTesterOptions.push_back("--tool=memcheck");
- this->MemoryTesterOptions.push_back("--leak-check=yes");
- this->MemoryTesterOptions.push_back("--show-reachable=yes");
- this->MemoryTesterOptions.push_back("--workaround-gcc296-bugs=yes");
- this->MemoryTesterOptions.push_back("--num-callers=50");
- }
- if ( this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").size() )
- {
- if ( !cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").c_str()) )
+ case cmCTestMemCheckHandler::VALGRIND:
+ if ( this->MemoryTesterOptions.empty() )
{
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Cannot find memory checker suppression file: "
- << this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").c_str() << std::endl);
- return false;
- }
- std::string suppressions = "--suppressions="
- + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile");
- this->MemoryTesterOptions.push_back(suppressions);
- }
- }
- else if ( this->MemoryTester.find("purify") != std::string::npos )
- {
- this->MemoryTesterStyle = cmCTestMemCheckHandler::PURIFY;
- std::string outputFile;
-#ifdef _WIN32
- if( this->CTest->GetCTestConfiguration(
+ this->MemoryTesterOptions.push_back("-q");
+ this->MemoryTesterOptions.push_back("--tool=memcheck");
+ this->MemoryTesterOptions.push_back("--leak-check=yes");
+ this->MemoryTesterOptions.push_back("--show-reachable=yes");
+ this->MemoryTesterOptions.push_back("--workaround-gcc296-bugs=yes");
+ this->MemoryTesterOptions.push_back("--num-callers=50");
+ }
+ if ( this->CTest->GetCTestConfiguration(
"MemoryCheckSuppressionFile").size() )
+ {
+ if ( !cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
+ "MemoryCheckSuppressionFile").c_str()) )
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Cannot find memory checker suppression file: "
+ << this->CTest->GetCTestConfiguration(
+ "MemoryCheckSuppressionFile").c_str() << std::endl);
+ return false;
+ }
+ std::string suppressions = "--suppressions="
+ + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile");
+ this->MemoryTesterOptions.push_back(suppressions);
+ }
+ break;
+ case cmCTestMemCheckHandler::PURIFY:
{
- if( !cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").c_str()) )
+ std::string outputFile;
+#ifdef _WIN32
+ if( this->CTest->GetCTestConfiguration(
+ "MemoryCheckSuppressionFile").size() )
{
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Cannot find memory checker suppression file: "
- << this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").c_str() << std::endl);
- return false;
- }
- std::string filterFiles = "/FilterFiles="
- + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile");
- this->MemoryTesterOptions.push_back(filterFiles);
- }
- outputFile = "/SAVETEXTDATA=";
+ if( !cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
+ "MemoryCheckSuppressionFile").c_str()) )
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Cannot find memory checker suppression file: "
+ << this->CTest->GetCTestConfiguration(
+ "MemoryCheckSuppressionFile").c_str() << std::endl);
+ return false;
+ }
+ std::string filterFiles = "/FilterFiles="
+ + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile");
+ this->MemoryTesterOptions.push_back(filterFiles);
+ }
+ outputFile = "/SAVETEXTDATA=";
#else
- outputFile = "-log-file=";
+ outputFile = "-log-file=";
#endif
- outputFile += this->MemoryTesterOutputFile;
- this->MemoryTesterOptions.push_back(outputFile);
- }
- else if ( this->MemoryTester.find("BC") != std::string::npos )
- {
- this->BoundsCheckerXMLFile = this->MemoryTesterOutputFile;
- std::string dpbdFile = this->CTest->GetBinaryDir()
- + "/Testing/Temporary/MemoryChecker.DPbd";
- this->BoundsCheckerDPBDFile = dpbdFile;
- this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
- this->MemoryTesterOptions.push_back("/B");
- this->MemoryTesterOptions.push_back(dpbdFile);
- this->MemoryTesterOptions.push_back("/X");
- this->MemoryTesterOptions.push_back(this->MemoryTesterOutputFile);
- this->MemoryTesterOptions.push_back("/M");
- }
- else
- {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Do not understand memory checker: " << this->MemoryTester.c_str()
- << std::endl);
- return false;
+ outputFile += this->MemoryTesterOutputFile;
+ this->MemoryTesterOptions.push_back(outputFile);
+ break;
+ }
+ case cmCTestMemCheckHandler::BOUNDS_CHECKER:
+ {
+ this->BoundsCheckerXMLFile = this->MemoryTesterOutputFile;
+ std::string dpbdFile = this->CTest->GetBinaryDir()
+ + "/Testing/Temporary/MemoryChecker.DPbd";
+ this->BoundsCheckerDPBDFile = dpbdFile;
+ this->MemoryTesterOptions.push_back("/B");
+ this->MemoryTesterOptions.push_back(dpbdFile);
+ this->MemoryTesterOptions.push_back("/X");
+ this->MemoryTesterOptions.push_back(this->MemoryTesterOutputFile);
+ this->MemoryTesterOptions.push_back("/M");
+ break;
+ }
+ default:
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Do not understand memory checker: " << this->MemoryTester.c_str()
+ << std::endl);
+ return false;
}
std::vector<cmStdString>::size_type cc;
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index ead449e..b796b83 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1304,9 +1304,10 @@ int cmCTestTestHandler::ExecuteCommands(std::vector<cmStdString>& vec)
for ( it = vec.begin(); it != vec.end(); ++it )
{
int retVal = 0;
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << *it
+ std::string cmd = cmSystemTools::ConvertToOutputPath(it->c_str());
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << cmd
<< std::endl);
- if ( !cmSystemTools::RunSingleCommand(it->c_str(), 0, &retVal, 0,
+ if ( !cmSystemTools::RunSingleCommand(cmd.c_str(), 0, &retVal, 0,
cmSystemTools::OUTPUT_MERGE
/*this->Verbose*/) || retVal != 0 )
{
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 8b2daba..00e1abc 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -623,7 +623,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
// the compilerdefines for this target
std::string cdefs = gtgt->GetCompileDefinitions();
- if(cdefs.empty())
+ if(!cdefs.empty())
{
// Expand the list.
std::vector<std::string> defs;
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 92e2052..287066a 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -17,7 +17,10 @@
#include "cmGeneratorExpression.h"
//----------------------------------------------------------------------------
-static void reportError(cmGeneratorExpressionContext *context,
+#if !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x510
+static
+#endif
+void reportError(cmGeneratorExpressionContext *context,
const std::string &expr, const std::string &result)
{
context->HadError = true;
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index ae69ce8..b404333 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -57,6 +57,8 @@ if(BUILD_TESTING)
add_subdirectory(FindPackageModeMakefileTest)
+ add_subdirectory(CTestTestMemcheck)
+
# Collect a list of all test build directories.
set(TEST_BUILD_DIRS)
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)