[cmake-commits] hoffman committed cmCTestMemCheckHandler.cxx 1.17 1.18

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Aug 10 16:28:50 EDT 2007


Update of /cvsroot/CMake/CMake/Source/CTest
In directory public:/mounts/ram/cvs-serv17088

Modified Files:
	cmCTestMemCheckHandler.cxx 
Log Message:
ENH: fix output and valgrind truncation issue


Index: cmCTestMemCheckHandler.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CTest/cmCTestMemCheckHandler.cxx,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- cmCTestMemCheckHandler.cxx	3 Aug 2007 20:35:22 -0000	1.17
+++ cmCTestMemCheckHandler.cxx	10 Aug 2007 20:28:48 -0000	1.18
@@ -202,6 +202,8 @@
 void cmCTestMemCheckHandler::Initialize()
 {
   this->Superclass::Initialize();
+  this->CustomMaximumPassedTestOutputSize = 0;
+  this->CustomMaximumFailedTestOutputSize = 0;
   this->MemoryTester = "";
   this->MemoryTesterOptionsParsed.clear();
   this->MemoryTesterOptions = "";
@@ -695,8 +697,13 @@
   bool outputFull = false;
   for ( cc = 0; cc < lines.size(); cc ++ )
     {
+    cmCTestLog(this->CTest, DEBUG, "test line "
+               << lines[cc] << std::endl);
+
     if ( valgrindLine.find(lines[cc]) )
       {
+      cmCTestLog(this->CTest, DEBUG, "valgrind  line "
+                 << lines[cc] << std::endl);
       int failure = cmCTestMemCheckHandler::NO_MEMORY_FAULT;
       if ( vgFIM.find(lines[cc]) )
         {
@@ -761,16 +768,8 @@
         results[failure] ++;
         defects ++;
         }
-      if(!outputFull)
-        {
-        totalOutputSize += lines[cc].size();
-        ostr << cmCTest::MakeXMLSafe(lines[cc]) << std::endl;
-        if(totalOutputSize > 
-           static_cast<size_t>(this->CustomMaximumFailedTestOutputSize))
-          {
-          outputFull = true;
-          }
-        }
+      totalOutputSize += lines[cc].size();
+      ostr << cmCTest::MakeXMLSafe(lines[cc]) << std::endl;
       } 
     else
       {
@@ -784,13 +783,18 @@
           nonValGrindOutput.begin(); i != nonValGrindOutput.end(); ++i)
       {
       totalOutputSize += lines[*i].size();
+      cmCTestLog(this->CTest, DEBUG, "before xml safe "
+                 << lines[*i] << std::endl);
+      cmCTestLog(this->CTest, DEBUG, "after  xml safe "
+                 <<  cmCTest::MakeXMLSafe(lines[*i]) << std::endl);
+
       ostr << cmCTest::MakeXMLSafe(lines[*i]) << std::endl;
       if(!unlimitedOutput && totalOutputSize > 
          static_cast<size_t>(this->CustomMaximumFailedTestOutputSize))
         {
         outputFull = true;
         ostr << "....\n";
-        ostr << "Output for this test has been truncated see testing"
+        ostr << "Test Output for this test has been truncated see testing"
           " machine logs for full output,\n";
         ostr << "or put CTEST_FULL_OUTPUT in the output of "
           "this test program.\n";



More information about the Cmake-commits mailing list