CTest: Fix MemoryCheckType from 'ctest -T MemCheck'

Before this commit, you would have to run ctest -S mode to get
MemoryCheckType to work. This is because CMAKE_COMMAND was not set.
The fix is to use cmSystemTools::GetCMakeCommand instead.
This commit is contained in:
Bill Hoffman 2014-07-15 14:19:14 -04:00 committed by Brad King
parent 4472671432
commit 1e005eadbc
2 changed files with 3 additions and 2 deletions

View File

@ -71,6 +71,7 @@ Compiler: @CMAKE_CXX_COMPILER@
PurifyCommand: @PURIFYCOMMAND@
ValgrindCommand: @VALGRIND_COMMAND@
ValgrindCommandOptions: @VALGRIND_COMMAND_OPTIONS@
MemoryCheckType: @MEMORYCHECK_TYPE@
MemoryCheckCommand: @MEMORYCHECK_COMMAND@
MemoryCheckCommandOptions: @MEMORYCHECK_COMMAND_OPTIONS@
MemoryCheckSuppressionFile: @MEMORYCHECK_SUPPRESSIONS_FILE@

View File

@ -346,8 +346,8 @@ void cmCTestMemCheckHandler::PopulateCustomVectors(cmMakefile *mf)
this->CTest->PopulateCustomVector(mf,
"CTEST_CUSTOM_MEMCHECK_IGNORE",
this->CustomTestsIgnore);
this->CTest->SetCTestConfigurationFromCMakeVariable(
mf, "CMakeCommand", "CMAKE_COMMAND");
std::string cmake = cmSystemTools::GetCMakeCommand();
this->CTest->SetCTestConfiguration("CMakeCommand", cmake.c_str());
}
//----------------------------------------------------------------------