[Cmake-commits] CMake branch, next, updated. v3.0.0-4488-gcefe04f

Bill Hoffman bill.hoffman at kitware.com
Thu Jul 24 11:32:05 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  cefe04f03d6888be7a80509225f2f6f509d445a6 (commit)
       via  5d40d88e0026824e237938a9e771206220857034 (commit)
       via  afe21fc3c43af0c031a77b3b48041d35f248f481 (commit)
      from  6ea3b0d99f179a85fc432a7e710bf2857fc5f7a5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cefe04f03d6888be7a80509225f2f6f509d445a6
commit cefe04f03d6888be7a80509225f2f6f509d445a6
Merge: 6ea3b0d 5d40d88
Author:     Bill Hoffman <bill.hoffman at kitware.com>
AuthorDate: Thu Jul 24 11:32:04 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jul 24 11:32:04 2014 -0400

    Merge topic 'sanitizer_handle_more_pids' into next
    
    5d40d88e Handle more than one process with sanitizer errors.
    afe21fc3 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d40d88e0026824e237938a9e771206220857034
commit 5d40d88e0026824e237938a9e771206220857034
Author:     Bill Hoffman <bill.hoffman at kitware.com>
AuthorDate: Thu Jul 24 11:25:59 2014 -0400
Commit:     Bill Hoffman <bill.hoffman at kitware.com>
CommitDate: Thu Jul 24 11:25:59 2014 -0400

    Handle more than one process with sanitizer errors.
    
    Since the Sanitizers write out one log file per process, a single
    test might have more than one log file. This commit allows ctest
    to read all of the log files found for a particual test.

diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index ed57949..ced7982 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -1127,7 +1127,13 @@ cmCTestMemCheckHandler::PostProcessTest(cmCTestTestResult& res,
     }
   else
     {
-    this->AppendMemTesterOutput(res, test);
+    std::vector<std::string> files;
+    this->TestOutputFileNames(test, files);
+    for(std::vector<std::string>::iterator i = files.begin();
+        i != files.end(); ++i)
+      {
+      this->AppendMemTesterOutput(res, *i);
+      }
     }
 }
 
@@ -1141,11 +1147,13 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res,
   cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
              "PostProcessBoundsCheckerTest for : "
              << res.Name << std::endl);
-  std::string ofile = this->TestOutputFileName(test);
-  if ( ofile.empty() )
+  std::vector<std::string> files;
+  this->TestOutputFileNames(test, files);
+  if ( files.size() == 0 )
     {
     return;
     }
+  std::string ofile = files[0];
   // put a scope around this to close ifs so the file can be removed
   {
   cmsys::ifstream ifs(ofile.c_str());
@@ -1175,9 +1183,8 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res,
 
 void
 cmCTestMemCheckHandler::AppendMemTesterOutput(cmCTestTestResult& res,
-                                              int test)
+                                              std::string const& ofile)
 {
-  std::string ofile = this->TestOutputFileName(test);
   if ( ofile.empty() )
     {
     return;
@@ -1205,8 +1212,9 @@ cmCTestMemCheckHandler::AppendMemTesterOutput(cmCTestTestResult& res,
     }
 }
 
-std::string
-cmCTestMemCheckHandler::TestOutputFileName(int test)
+void cmCTestMemCheckHandler::TestOutputFileNames(int test,
+                                                 std::vector<std::string>&
+                                                 files)
 {
   std::string index;
   cmOStringStream stream;
@@ -1229,7 +1237,8 @@ cmCTestMemCheckHandler::TestOutputFileName(int test)
       }
     else
       {
-      ofile = g.GetFiles()[0];
+      files = g.GetFiles();
+      return;
       }
     }
   else if ( !cmSystemTools::FileExists(ofile.c_str()) )
@@ -1239,5 +1248,5 @@ cmCTestMemCheckHandler::TestOutputFileName(int test)
     cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl);
     ofile = "";
     }
-  return ofile;
+  files.push_back(ofile);
 }
diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h
index 2630fde..2195dab 100644
--- a/Source/CTest/cmCTestMemCheckHandler.h
+++ b/Source/CTest/cmCTestMemCheckHandler.h
@@ -145,10 +145,10 @@ private:
 
   ///! append MemoryTesterOutputFile to the test log
   void AppendMemTesterOutput(cmCTestTestHandler::cmCTestTestResult& res,
-                             int test);
+                             std::string const& filename);
 
   ///! generate the output filename for the given test index
-  std::string TestOutputFileName(int test);
+  void TestOutputFileNames(int test, std::vector<std::string>& files);
 };
 
 #endif
diff --git a/Tests/CTestTestMemcheck/testLeakSanitizer.cmake b/Tests/CTestTestMemcheck/testLeakSanitizer.cmake
index d0e38ce..02030be 100644
--- a/Tests/CTestTestMemcheck/testLeakSanitizer.cmake
+++ b/Tests/CTestTestMemcheck/testLeakSanitizer.cmake
@@ -11,6 +11,7 @@ endif()
 
 # clear the log file
 file(REMOVE "${LOG_FILE}.2343")
+file(REMOVE "${LOG_FILE}.2344")
 
 # create an error of each type of thread santizer
 # these names come from tsan_report.cc in llvm
@@ -24,6 +25,12 @@ Direct leak of 4360 byte(s) in 1 object(s) allocated from:
     #1 0x4823b4 in main /home/kitware/msan/memcheck.cxx:12
     #2 0x7fa72bee476c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226
 
+SUMMARY: AddressSanitizer: 4436 byte(s) leaked in 2 allocation(s).
+")
+file(APPEND "${LOG_FILE}.2342"
+"=================================================================
+==25308==ERROR: LeakSanitizer: detected memory leaks
+
 Direct leak of 76 byte(s) in 1 object(s) allocated from:
     #0 0x46c669 in operator new[](unsigned long) (/home/kitware/msan/a.out+0x46c669)
     #1 0x4821b8 in foo() /home/kitware/msan/memcheck.cxx:4

-----------------------------------------------------------------------

Summary of changes:
 Source/CMakeVersion.cmake                       |    2 +-
 Source/CTest/cmCTestMemCheckHandler.cxx         |   27 +++++++++++++++--------
 Source/CTest/cmCTestMemCheckHandler.h           |    4 ++--
 Tests/CTestTestMemcheck/testLeakSanitizer.cmake |    7 ++++++
 4 files changed, 28 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list