summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestCoverageHandler.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-10-18 02:47:44 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-10-18 02:47:44 (GMT)
commitace5f90d9c991250ec31080341b7d0b90bd3d8dc (patch)
treea5686ca1ddfc69e6961f120dde895bc354f461c9 /Source/CTest/cmCTestCoverageHandler.cxx
parentb40cd9fc3bf75f88c98130ab3365c4d69f67baaf (diff)
downloadCMake-ace5f90d9c991250ec31080341b7d0b90bd3d8dc.zip
CMake-ace5f90d9c991250ec31080341b7d0b90bd3d8dc.tar.gz
CMake-ace5f90d9c991250ec31080341b7d0b90bd3d8dc.tar.bz2
BUG: Fix output to match the Dart output
Diffstat (limited to 'Source/CTest/cmCTestCoverageHandler.cxx')
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index e6edc31..204d684 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -50,17 +50,19 @@ bool cmCTestCoverageHandler::StartLogFile(std::ofstream& covLogFile, int logFile
return false;
}
std::string local_start_time = m_CTest->CurrentTime();
+ m_CTest->StartXML(covLogFile);
covLogFile << "<CoverageLog>" << std::endl
<< "\t<StartDateTime>" << local_start_time << "</StartDateTime>" << std::endl;
return true;
}
//----------------------------------------------------------------------
-void cmCTestCoverageHandler::StopLogFile(std::ofstream& ostr, int logFileCount)
+void cmCTestCoverageHandler::EndLogFile(std::ofstream& ostr, int logFileCount)
{
std::string local_end_time = m_CTest->CurrentTime();
ostr << "\t<EndDateTime>" << local_end_time << "</EndDateTime>" << std::endl
<< "</CoverageLog>" << std::endl;
+ m_CTest->EndXML(ostr);
char covLogFilename[1024];
sprintf(covLogFilename, "CoverageLog-%d.xml", logFileCount);
std::cout << "Close file: " << covLogFilename << std::endl;
@@ -276,7 +278,6 @@ int cmCTestCoverageHandler::CoverageDirectory(cmCTest *ctest_inst)
{
std::cout << " in file: " << fname << std::endl;
}
- singleFileCoverageVector cov;
std::ifstream ifile(fname.c_str());
if ( ! ifile )
{
@@ -356,7 +357,7 @@ int cmCTestCoverageHandler::CoverageDirectory(cmCTest *ctest_inst)
if ( cnt == 100 )
{
cnt = 0;
- this->StopLogFile(covLogFile, logFileCount);
+ this->EndLogFile(covLogFile, logFileCount);
logFileCount ++;
if ( !this->StartLogFile(covLogFile, logFileCount) )
{
@@ -396,7 +397,8 @@ int cmCTestCoverageHandler::CoverageDirectory(cmCTest *ctest_inst)
const singleFileCoverageVector& fcov = fileIterator->second;
covLogFile << "\t<File Name=\""
<< m_CTest->MakeXMLSafe(fileName.c_str())
- << "\" FullPath=\"" << m_CTest->MakeXMLSafe(fileIterator->first) << "\">" << std::endl
+ << "\" FullPath=\"" << m_CTest->MakeXMLSafe(m_CTest->GetShortPathToFile(
+ fileIterator->first.c_str())) << "\">" << std::endl
<< "\t\t<Report>" << std::endl;
std::ifstream ifs(fullFileName.c_str());
@@ -449,7 +451,8 @@ int cmCTestCoverageHandler::CoverageDirectory(cmCTest *ctest_inst)
covLogFile << "\t\t</Report>" << std::endl
<< "\t</File>" << std::endl;
covSumFile << "\t<File Name=\"" << m_CTest->MakeXMLSafe(fileName)
- << "\" FullPath=\"" << m_CTest->MakeXMLSafe(fullFileName)
+ << "\" FullPath=\"" << m_CTest->MakeXMLSafe(
+ m_CTest->GetShortPathToFile(fullFileName.c_str()))
<< "\" Covered=\"" << (cmet>0?"true":"false") << "\">\n"
<< "\t\t<LOCTested>" << tested << "</LOCTested>\n"
<< "\t\t<LOCUnTested>" << untested << "</LOCUnTested>\n"
@@ -464,7 +467,7 @@ int cmCTestCoverageHandler::CoverageDirectory(cmCTest *ctest_inst)
<< "\t</File>" << std::endl;
cnt ++;
}
- this->StopLogFile(covLogFile, logFileCount);
+ this->EndLogFile(covLogFile, logFileCount);
int total_lines = total_tested + total_untested;
float percent_coverage = 100 * SAFEDIV(static_cast<float>(total_tested),