[Cmake-commits] [cmake-commits] zach.mullen committed cmCTestMemCheckHandler.cxx 1.24 1.25 cmCTestMemCheckHandler.h 1.4 1.5 cmCTestMultiProcessHandler.cxx 1.9 1.10 cmCTestRunTest.cxx 1.6 1.7 cmCTestRunTest.h 1.4 1.5 cmCTestTestHandler.cxx 1.108 1.109 cmCTestTestHandler.h 1.42 1.43
cmake-commits at cmake.org
cmake-commits at cmake.org
Fri Aug 28 15:08:06 EDT 2009
Update of /cvsroot/CMake/CMake/Source/CTest
In directory public:/mounts/ram/cvs-serv6602
Modified Files:
cmCTestMemCheckHandler.cxx cmCTestMemCheckHandler.h
cmCTestMultiProcessHandler.cxx cmCTestRunTest.cxx
cmCTestRunTest.h cmCTestTestHandler.cxx cmCTestTestHandler.h
Log Message:
MemCheck should now work again in ctest
Index: cmCTestMemCheckHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestMemCheckHandler.cxx,v
retrieving revision 1.24
retrieving revision 1.25
diff -C 2 -d -r1.24 -r1.25
*** cmCTestMemCheckHandler.cxx 28 Aug 2009 15:08:39 -0000 1.24
--- cmCTestMemCheckHandler.cxx 28 Aug 2009 19:08:03 -0000 1.25
***************
*** 250,262 ****
//----------------------------------------------------------------------
void cmCTestMemCheckHandler::GenerateTestCommand(
! std::vector<const char*>& args)
{
std::vector<cmStdString>::size_type pp;
- args.push_back(this->MemoryTester.c_str());
std::string memcheckcommand = "";
memcheckcommand = this->MemoryTester;
for ( pp = 0; pp < this->MemoryTesterOptionsParsed.size(); pp ++ )
{
! args.push_back(this->MemoryTesterOptionsParsed[pp].c_str());
memcheckcommand += " ";
memcheckcommand += cmSystemTools::EscapeSpaces(
--- 250,261 ----
//----------------------------------------------------------------------
void cmCTestMemCheckHandler::GenerateTestCommand(
! std::vector<std::string>& args)
{
std::vector<cmStdString>::size_type pp;
std::string memcheckcommand = "";
memcheckcommand = this->MemoryTester;
for ( pp = 0; pp < this->MemoryTesterOptionsParsed.size(); pp ++ )
{
! args.push_back(this->MemoryTesterOptionsParsed[pp]);
memcheckcommand += " ";
memcheckcommand += cmSystemTools::EscapeSpaces(
***************
*** 868,892 ****
return true;
}
- //TODO ZACH move this logic into cmCTestRunTest
- void
- cmCTestMemCheckHandler::ProcessOneTest(cmCTestTestProperties *props,
- std::vector<cmStdString> &passed,
- std::vector<cmStdString> &failed,
- int count, int tmsize)
- {
- // run parent test
- cmCTestTestHandler::ProcessOneTest(props, passed, failed, count, tmsize);
- cmCTestTestResult& res = this->TestResults[this->TestResults.size()-1];
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "process test output now: "
- << props->Name.c_str() << " " << res.Name.c_str() << std::endl);
- if( this->MemoryTesterStyle == cmCTestMemCheckHandler::BOUNDS_CHECKER)
- {
- this->PostProcessBoundsCheckerTest(res);
- }
- else if(this->MemoryTesterStyle == cmCTestMemCheckHandler::PURIFY )
- {
- this->PostProcessPurifyTest(res);
- }
- }
// This method puts the bounds checker output file into the output
--- 867,870 ----
Index: cmCTestRunTest.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestRunTest.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -C 2 -d -r1.6 -r1.7
*** cmCTestRunTest.cxx 28 Aug 2009 15:40:34 -0000 1.6
--- cmCTestRunTest.cxx 28 Aug 2009 19:08:03 -0000 1.7
***************
*** 17,20 ****
--- 17,21 ----
#include "cmCTestRunTest.h"
+ #include "cmCTestMemCheckHandler.h"
#include "cmCTest.h"
#include "cmSystemTools.h"
***************
*** 246,253 ****
--- 247,279 ----
this->TestHandler->TestResults.push_back( this->TestResult );
+ this->MemCheckPostProcess();
+
delete this->TestProcess;
return passed;
}
+ //--------------------------------------------------------------
+ void cmCTestRunTest::MemCheckPostProcess()
+ {
+ if(!this->TestHandler->MemCheck)
+ {
+ return;
+ }
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index
+ << ": process test output now: "
+ << this->TestProperties->Name.c_str() << " "
+ << this->TestResult.Name.c_str() << std::endl);
+ cmCTestMemCheckHandler * handler = static_cast<cmCTestMemCheckHandler*>
+ (this->TestHandler);
+ if(handler->MemoryTesterStyle == cmCTestMemCheckHandler::BOUNDS_CHECKER)
+ {
+ handler->PostProcessBoundsCheckerTest(this->TestResult);
+ }
+ else if(handler->MemoryTesterStyle == cmCTestMemCheckHandler::PURIFY)
+ {
+ handler->PostProcessPurifyTest(this->TestResult);
+ }
+ }
+
void cmCTestRunTest::SetTestHandler(cmCTestTestHandler * handler)
{
***************
*** 293,311 ****
void cmCTestRunTest::ComputeArguments()
{
- std::vector<std::string>& args = this->TestProperties->Args;
- // find the test executable
- this->ActualCommand
- = this->TestHandler->FindTheExecutable(args[1].c_str());
- this->TestCommand
- = cmSystemTools::ConvertToOutputPath(this->ActualCommand.c_str());
- // add the arguments
std::vector<std::string>::const_iterator j =
this->TestProperties->Args.begin();
++j; // skip test name
- ++j; // skip command as it is in actualCommand
! //TODO ZACH the problem is here for memcheck. We need to call
! //memcheckhandler.GenerateTestCommand BEFORE we run the process.
! // this->TestHandler->GenerateTestCommand(this->Arguments);
for(;j != this->TestProperties->Args.end(); ++j)
{
--- 319,352 ----
void cmCTestRunTest::ComputeArguments()
{
std::vector<std::string>::const_iterator j =
this->TestProperties->Args.begin();
++j; // skip test name
! // find the test executable
! if(this->TestHandler->MemCheck)
! {
! cmCTestMemCheckHandler * handler = static_cast<cmCTestMemCheckHandler*>
! (this->TestHandler);
! this->ActualCommand = handler->MemoryTester.c_str();
! }
! else
! {
! this->ActualCommand =
! this->TestHandler->FindTheExecutable(
! this->TestProperties->Args[1].c_str());
! ++j; //skip the executable (it will be actualCommand)
! }
! this->TestCommand
! = cmSystemTools::ConvertToOutputPath(this->ActualCommand.c_str());
!
! //Prepends memcheck args to our command string
! this->TestHandler->GenerateTestCommand(this->Arguments);
! for(std::vector<std::string>::iterator i = this->Arguments.begin();
! i != this->Arguments.end(); ++i)
! {
! this->TestCommand += " ";
! this->TestCommand += cmSystemTools::EscapeSpaces(j->c_str());
! }
!
for(;j != this->TestProperties->Args.end(); ++j)
{
***************
*** 414,421 ****
outname.resize(maxTestNameWidth, '.');
! *this->TestHandler->LogFile << this->TestProperties->Index << "/"
<< this->TestHandler->TotalNumberOfTests << " Testing: "
<< this->TestProperties->Name << std::endl;
! *this->TestHandler->LogFile << this->TestProperties->Index << "/"
<< this->TestHandler->TotalNumberOfTests
<< " Test: " << this->TestProperties->Name.c_str() << std::endl;
--- 455,462 ----
outname.resize(maxTestNameWidth, '.');
! *this->TestHandler->LogFile << this->TestProperties->Index << "/"
<< this->TestHandler->TotalNumberOfTests << " Testing: "
<< this->TestProperties->Name << std::endl;
! *this->TestHandler->LogFile << this->TestProperties->Index << "/"
<< this->TestHandler->TotalNumberOfTests
<< " Test: " << this->TestProperties->Name.c_str() << std::endl;
Index: cmCTestMultiProcessHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestMultiProcessHandler.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -C 2 -d -r1.9 -r1.10
*** cmCTestMultiProcessHandler.cxx 28 Aug 2009 15:08:39 -0000 1.9
--- cmCTestMultiProcessHandler.cxx 28 Aug 2009 19:08:03 -0000 1.10
***************
*** 248,254 ****
testRun.ComputeArguments(); //logs the command in verbose mode
! cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(3)
<< count << "/");
! cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(3)
<< this->Total << " ");
if (this->TestHandler->MemCheck)
--- 248,254 ----
testRun.ComputeArguments(); //logs the command in verbose mode
! cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(3)
<< count << "/");
! cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(3)
<< this->Total << " ");
if (this->TestHandler->MemCheck)
Index: cmCTestTestHandler.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestTestHandler.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -C 2 -d -r1.42 -r1.43
*** cmCTestTestHandler.h 28 Aug 2009 15:08:39 -0000 1.42
--- cmCTestTestHandler.h 28 Aug 2009 19:08:03 -0000 1.43
***************
*** 136,140 ****
virtual int PreProcessHandler();
virtual int PostProcessHandler();
! virtual void GenerateTestCommand(std::vector<const char*>& args);
int ExecuteCommands(std::vector<cmStdString>& vec);
--- 136,140 ----
virtual int PreProcessHandler();
virtual int PostProcessHandler();
! virtual void GenerateTestCommand(std::vector<std::string>& args);
int ExecuteCommands(std::vector<cmStdString>& vec);
***************
*** 158,172 ****
int CustomMaximumPassedTestOutputSize;
int CustomMaximumFailedTestOutputSize;
- protected:
- /**
- * Run one test
- */
- virtual void ProcessOneTest(cmCTestTestProperties *props,
- std::vector<cmStdString> &passed,
- std::vector<cmStdString> &failed,
- int count, int tmsize);
-
-
-
public:
enum { // Program statuses
--- 158,161 ----
Index: cmCTestMemCheckHandler.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestMemCheckHandler.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C 2 -d -r1.4 -r1.5
*** cmCTestMemCheckHandler.h 24 Jul 2007 18:43:31 -0000 1.4
--- cmCTestMemCheckHandler.h 28 Aug 2009 19:08:03 -0000 1.5
***************
*** 31,34 ****
--- 31,35 ----
class cmCTestMemCheckHandler : public cmCTestTestHandler
{
+ friend class cmCTestRunTest;
public:
cmTypeMacro(cmCTestMemCheckHandler, cmCTestTestHandler);
***************
*** 42,46 ****
virtual int PreProcessHandler();
virtual int PostProcessHandler();
! virtual void GenerateTestCommand(std::vector<const char*>& args);
private:
--- 43,47 ----
virtual int PreProcessHandler();
virtual int PostProcessHandler();
! virtual void GenerateTestCommand(std::vector<std::string>& args);
private:
***************
*** 122,132 ****
bool ProcessMemCheckBoundsCheckerOutput(const std::string& str,
std::string& log, int* results);
! /**
! * Run one test
! */
! virtual void ProcessOneTest(cmCTestTestProperties *props,
! std::vector<cmStdString> &passed,
! std::vector<cmStdString> &failed,
! int count, int tmsize);
void PostProcessPurifyTest(cmCTestTestResult& res);
void PostProcessBoundsCheckerTest(cmCTestTestResult& res);
--- 123,127 ----
bool ProcessMemCheckBoundsCheckerOutput(const std::string& str,
std::string& log, int* results);
!
void PostProcessPurifyTest(cmCTestTestResult& res);
void PostProcessBoundsCheckerTest(cmCTestTestResult& res);
Index: cmCTestTestHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestTestHandler.cxx,v
retrieving revision 1.108
retrieving revision 1.109
diff -C 2 -d -r1.108 -r1.109
*** cmCTestTestHandler.cxx 28 Aug 2009 15:08:39 -0000 1.108
--- cmCTestTestHandler.cxx 28 Aug 2009 19:08:03 -0000 1.109
***************
*** 710,714 ****
}
}
!
//----------------------------------------------------------------------
void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it,
--- 710,714 ----
}
}
! /*
//----------------------------------------------------------------------
void cmCTestTestHandler::ProcessOneTest(cmCTestTestProperties *it,
***************
*** 792,798 ****
arguments.push_back(0);
- /**
- * Run an executable command and put the stdout in output.
- */
std::string output;
int retVal = 0;
--- 792,795 ----
***************
*** 1027,1031 ****
this->TestResults.push_back( cres );
}
!
//----------------------------------------------------------------------
void cmCTestTestHandler::CheckLabelFilterInclude(cmCTestTestProperties& it)
--- 1024,1028 ----
this->TestResults.push_back( cres );
}
! */
//----------------------------------------------------------------------
void cmCTestTestHandler::CheckLabelFilterInclude(cmCTestTestProperties& it)
***************
*** 1364,1368 ****
//----------------------------------------------------------------------
! void cmCTestTestHandler::GenerateTestCommand(std::vector<const char*>&)
{
}
--- 1361,1365 ----
//----------------------------------------------------------------------
! void cmCTestTestHandler::GenerateTestCommand(std::vector<std::string>&)
{
}
Index: cmCTestRunTest.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestRunTest.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C 2 -d -r1.4 -r1.5
*** cmCTestRunTest.h 28 Aug 2009 15:08:39 -0000 1.4
--- cmCTestRunTest.h 28 Aug 2009 19:08:03 -0000 1.5
***************
*** 65,68 ****
--- 65,70 ----
std::vector<std::string>* environment);
void WriteLogOutputTop(int completed, int total);
+ //Run post processing of the process output for MemCheck
+ void MemCheckPostProcess();
cmCTestTestHandler::cmCTestTestProperties * TestProperties;
More information about the Cmake-commits
mailing list