[Cmake-commits] CMake branch, master, updated. 231cbbef80210da31385427b45361f76d81ee294

cmake-commits at cmake.org cmake-commits at cmake.org
Fri May 7 11:00:48 EDT 2010


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, master has been updated
       via  231cbbef80210da31385427b45361f76d81ee294 (commit)
      from  678073bec29201e9edba2b00b6f3c96a528fe610 (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=231cbbef80210da31385427b45361f76d81ee294
commit 231cbbef80210da31385427b45361f76d81ee294
Author: Zach Mullen <zach.mullen at kitware.com>
Date:   Fri May 7 11:00:21 2010 -0400

    Change coverage globbing mechanism to resolve paths earlier

diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index a5b6caf..e66af24 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -583,17 +583,17 @@ int cmCTestCoverageHandler::ProcessHandler()
       i != uncovered.end(); ++i)
     {
     std::string fileName = cmSystemTools::GetFilenameName(*i);
-    std::string shortFileName = this->CTest->GetShortPathToFile(i->c_str());
+    std::string fullPath = cont.SourceDir + "/" + *i;
 
     covLogFile << "\t<File Name=\"" << cmXMLSafe(fileName)
-      << "\" FullPath=\"" << cmXMLSafe(shortFileName) << "\">\n"
+      << "\" FullPath=\"" << cmXMLSafe(*i) << "\">\n"
       << "\t\t<Report>" << std::endl;
 
-    std::ifstream ifs(i->c_str());
+    std::ifstream ifs(fullPath.c_str());
     if (!ifs)
       {
       cmOStringStream ostr;
-      ostr <<  "Cannot open source file: " << i->c_str();
+      ostr <<  "Cannot open source file: " << fullPath.c_str();
       errorsWhileAccumulating.push_back(ostr.str());
       error ++;
       continue;
@@ -611,14 +611,14 @@ int cmCTestCoverageHandler::ProcessHandler()
     covLogFile << "\t\t</Report>\n\t</File>" << std::endl;
 
     total_untested += untested;
-    covSumFile << "\t<File Name=\"" << cmXMLSafe(i->c_str())
-      << "\" FullPath=\"" << cmXMLSafe(shortFileName.c_str())
+    covSumFile << "\t<File Name=\"" << cmXMLSafe(fileName)
+      << "\" FullPath=\"" << cmXMLSafe(i->c_str())
       << "\" Covered=\"true\">\n"
       << "\t\t<LOCTested>0</LOCTested>\n"
       << "\t\t<LOCUnTested>" << untested << "</LOCUnTested>\n"
       << "\t\t<PercentCoverage>0</PercentCoverage>\n"
       << "\t\t<CoverageMetric>0</CoverageMetric>\n";
-    this->WriteXMLLabels(covSumFile, shortFileName);
+    this->WriteXMLLabels(covSumFile, *i);
     covSumFile << "\t</File>" << std::endl;
     }
 
@@ -628,7 +628,7 @@ int cmCTestCoverageHandler::ProcessHandler()
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE, std::endl);
     cmCTestLog(this->CTest, ERROR_MESSAGE,
-      "Error(s) while acumulating results:" << std::endl);
+      "Error(s) while accumulating results:" << std::endl);
     std::vector<std::string>::iterator erIt;
     for ( erIt = errorsWhileAccumulating.begin();
       erIt != errorsWhileAccumulating.end();
@@ -2031,7 +2031,12 @@ std::set<std::string> cmCTestCoverageHandler::FindUncoveredFiles(
     std::string glob = cont->SourceDir + "/" + *i;
     gl.FindFiles(glob);
     std::vector<std::string> files = gl.GetFiles();
-    extraMatches.insert(files.begin(), files.end());
+    for(std::vector<std::string>::iterator i = files.begin();
+        i != files.end(); ++i)
+      {
+      extraMatches.insert(this->CTest->GetShortPathToFile(
+        i->c_str()));
+      }
     }
 
   if(extraMatches.size())
@@ -2041,9 +2046,7 @@ std::set<std::string> cmCTestCoverageHandler::FindUncoveredFiles(
       {
       std::string shortPath = this->CTest->GetShortPathToFile(
         i->first.c_str());
-      shortPath= shortPath.substr(2, shortPath.length() - 1);
-      std::string fullPath = cont->SourceDir + "/" + shortPath;
-      extraMatches.erase(fullPath);
+      extraMatches.erase(shortPath);
       }
     }
   return extraMatches;

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

Summary of changes:
 Source/CTest/cmCTestCoverageHandler.cxx |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list