mirror of
https://github.com/reactos/CMake.git
synced 2024-12-12 13:56:00 +00:00
BUG: Fix output to match the Dart output
This commit is contained in:
parent
b40cd9fc3b
commit
ace5f90d9c
@ -50,17 +50,19 @@ bool cmCTestCoverageHandler::StartLogFile(std::ofstream& covLogFile, int logFile
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
std::string local_start_time = m_CTest->CurrentTime();
|
std::string local_start_time = m_CTest->CurrentTime();
|
||||||
|
m_CTest->StartXML(covLogFile);
|
||||||
covLogFile << "<CoverageLog>" << std::endl
|
covLogFile << "<CoverageLog>" << std::endl
|
||||||
<< "\t<StartDateTime>" << local_start_time << "</StartDateTime>" << std::endl;
|
<< "\t<StartDateTime>" << local_start_time << "</StartDateTime>" << std::endl;
|
||||||
return true;
|
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();
|
std::string local_end_time = m_CTest->CurrentTime();
|
||||||
ostr << "\t<EndDateTime>" << local_end_time << "</EndDateTime>" << std::endl
|
ostr << "\t<EndDateTime>" << local_end_time << "</EndDateTime>" << std::endl
|
||||||
<< "</CoverageLog>" << std::endl;
|
<< "</CoverageLog>" << std::endl;
|
||||||
|
m_CTest->EndXML(ostr);
|
||||||
char covLogFilename[1024];
|
char covLogFilename[1024];
|
||||||
sprintf(covLogFilename, "CoverageLog-%d.xml", logFileCount);
|
sprintf(covLogFilename, "CoverageLog-%d.xml", logFileCount);
|
||||||
std::cout << "Close file: " << covLogFilename << std::endl;
|
std::cout << "Close file: " << covLogFilename << std::endl;
|
||||||
@ -276,7 +278,6 @@ int cmCTestCoverageHandler::CoverageDirectory(cmCTest *ctest_inst)
|
|||||||
{
|
{
|
||||||
std::cout << " in file: " << fname << std::endl;
|
std::cout << " in file: " << fname << std::endl;
|
||||||
}
|
}
|
||||||
singleFileCoverageVector cov;
|
|
||||||
std::ifstream ifile(fname.c_str());
|
std::ifstream ifile(fname.c_str());
|
||||||
if ( ! ifile )
|
if ( ! ifile )
|
||||||
{
|
{
|
||||||
@ -356,7 +357,7 @@ int cmCTestCoverageHandler::CoverageDirectory(cmCTest *ctest_inst)
|
|||||||
if ( cnt == 100 )
|
if ( cnt == 100 )
|
||||||
{
|
{
|
||||||
cnt = 0;
|
cnt = 0;
|
||||||
this->StopLogFile(covLogFile, logFileCount);
|
this->EndLogFile(covLogFile, logFileCount);
|
||||||
logFileCount ++;
|
logFileCount ++;
|
||||||
if ( !this->StartLogFile(covLogFile, logFileCount) )
|
if ( !this->StartLogFile(covLogFile, logFileCount) )
|
||||||
{
|
{
|
||||||
@ -396,7 +397,8 @@ int cmCTestCoverageHandler::CoverageDirectory(cmCTest *ctest_inst)
|
|||||||
const singleFileCoverageVector& fcov = fileIterator->second;
|
const singleFileCoverageVector& fcov = fileIterator->second;
|
||||||
covLogFile << "\t<File Name=\""
|
covLogFile << "\t<File Name=\""
|
||||||
<< m_CTest->MakeXMLSafe(fileName.c_str())
|
<< 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;
|
<< "\t\t<Report>" << std::endl;
|
||||||
|
|
||||||
std::ifstream ifs(fullFileName.c_str());
|
std::ifstream ifs(fullFileName.c_str());
|
||||||
@ -449,7 +451,8 @@ int cmCTestCoverageHandler::CoverageDirectory(cmCTest *ctest_inst)
|
|||||||
covLogFile << "\t\t</Report>" << std::endl
|
covLogFile << "\t\t</Report>" << std::endl
|
||||||
<< "\t</File>" << std::endl;
|
<< "\t</File>" << std::endl;
|
||||||
covSumFile << "\t<File Name=\"" << m_CTest->MakeXMLSafe(fileName)
|
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"
|
<< "\" Covered=\"" << (cmet>0?"true":"false") << "\">\n"
|
||||||
<< "\t\t<LOCTested>" << tested << "</LOCTested>\n"
|
<< "\t\t<LOCTested>" << tested << "</LOCTested>\n"
|
||||||
<< "\t\t<LOCUnTested>" << untested << "</LOCUnTested>\n"
|
<< "\t\t<LOCUnTested>" << untested << "</LOCUnTested>\n"
|
||||||
@ -464,7 +467,7 @@ int cmCTestCoverageHandler::CoverageDirectory(cmCTest *ctest_inst)
|
|||||||
<< "\t</File>" << std::endl;
|
<< "\t</File>" << std::endl;
|
||||||
cnt ++;
|
cnt ++;
|
||||||
}
|
}
|
||||||
this->StopLogFile(covLogFile, logFileCount);
|
this->EndLogFile(covLogFile, logFileCount);
|
||||||
|
|
||||||
int total_lines = total_tested + total_untested;
|
int total_lines = total_tested + total_untested;
|
||||||
float percent_coverage = 100 * SAFEDIV(static_cast<float>(total_tested),
|
float percent_coverage = 100 * SAFEDIV(static_cast<float>(total_tested),
|
||||||
|
@ -50,7 +50,7 @@ private:
|
|||||||
bool ShouldIDoCoverage(const char* file, const char* srcDir,
|
bool ShouldIDoCoverage(const char* file, const char* srcDir,
|
||||||
const char* binDir, bool verbose);
|
const char* binDir, bool verbose);
|
||||||
bool StartLogFile(std::ofstream& ostr, int logFileCount);
|
bool StartLogFile(std::ofstream& ostr, int logFileCount);
|
||||||
void StopLogFile(std::ofstream& ostr, int logFileCount);
|
void EndLogFile(std::ofstream& ostr, int logFileCount);
|
||||||
|
|
||||||
struct cmCTestCoverage
|
struct cmCTestCoverage
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user