CTest: Rename coverage implementation for "Python" to "Cobertura"

The coverage.py tool writes out an XML that conforms to the Cobertura
Coverage tool standard.  Rename the cmParsePythonCoverage files to
instead be cmParseCoberturaCoverage.
This commit is contained in:
Joseph Snyder 2014-06-03 18:30:46 +00:00
parent 0ee116b7eb
commit a2822d3089
5 changed files with 17 additions and 17 deletions

View File

@ -519,7 +519,7 @@ set(CTEST_SRCS cmCTest.cxx
CTest/cmParseCacheCoverage.cxx
CTest/cmParseGTMCoverage.cxx
CTest/cmParsePHPCoverage.cxx
CTest/cmParsePythonCoverage.cxx
CTest/cmParseCoberturaCoverage.cxx
CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
CTest/cmCTestGenericHandler.cxx
CTest/cmCTestHandlerCommand.cxx

View File

@ -11,7 +11,7 @@
============================================================================*/
#include "cmCTestCoverageHandler.h"
#include "cmParsePHPCoverage.h"
#include "cmParsePythonCoverage.h"
#include "cmParseCoberturaCoverage.h"
#include "cmParseGTMCoverage.h"
#include "cmParseCacheCoverage.h"
#include "cmCTest.h"
@ -401,7 +401,7 @@ int cmCTestCoverageHandler::ProcessHandler()
{
return error;
}
file_count += this->HandlePythonCoverage(&cont);
file_count += this->HandleCoberturaCoverage(&cont);
error = cont.Error;
if ( file_count < 0 )
{
@ -779,10 +779,10 @@ int cmCTestCoverageHandler::HandlePHPCoverage(
}
//----------------------------------------------------------------------
int cmCTestCoverageHandler::HandlePythonCoverage(
int cmCTestCoverageHandler::HandleCoberturaCoverage(
cmCTestCoverageHandlerContainer* cont)
{
cmParsePythonCoverage cov(*cont, this->CTest);
cmParseCoberturaCoverage cov(*cont, this->CTest);
// Assume the coverage.xml is in the source directory
std::string coverageXMLFile = this->CTest->GetBinaryDir() + "/coverage.xml";
@ -790,14 +790,14 @@ int cmCTestCoverageHandler::HandlePythonCoverage(
if(cmSystemTools::FileExists(coverageXMLFile.c_str()))
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Parsing coverage.py XML file: " << coverageXMLFile
"Parsing Cobertura XML file: " << coverageXMLFile
<< std::endl);
cov.ReadCoverageXML(coverageXMLFile.c_str());
}
else
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Cannot find coverage.py XML file: " << coverageXMLFile
"Cannot find Cobertura XML file: " << coverageXMLFile
<< std::endl);
}
return static_cast<int>(cont->TotalCoverage.size());

View File

@ -76,7 +76,7 @@ private:
int HandlePHPCoverage(cmCTestCoverageHandlerContainer* cont);
//! Handle coverage for Python with coverage.py
int HandlePythonCoverage(cmCTestCoverageHandlerContainer* cont);
int HandleCoberturaCoverage(cmCTestCoverageHandlerContainer* cont);
//! Handle coverage for mumps
int HandleMumpsCoverage(cmCTestCoverageHandlerContainer* cont);

View File

@ -1,12 +1,12 @@
#include "cmStandardIncludes.h"
#include "cmSystemTools.h"
#include "cmXMLParser.h"
#include "cmParsePythonCoverage.h"
#include "cmParseCoberturaCoverage.h"
#include <cmsys/Directory.hxx>
#include <cmsys/FStream.hxx>
//----------------------------------------------------------------------------
class cmParsePythonCoverage::XMLParser: public cmXMLParser
class cmParseCoberturaCoverage::XMLParser: public cmXMLParser
{
public:
XMLParser(cmCTest* ctest, cmCTestCoverageHandlerContainer& cont)
@ -104,16 +104,16 @@ private:
};
cmParsePythonCoverage::cmParsePythonCoverage(
cmParseCoberturaCoverage::cmParseCoberturaCoverage(
cmCTestCoverageHandlerContainer& cont,
cmCTest* ctest)
:Coverage(cont), CTest(ctest)
{
}
bool cmParsePythonCoverage::ReadCoverageXML(const char* xmlFile)
bool cmParseCoberturaCoverage::ReadCoverageXML(const char* xmlFile)
{
cmParsePythonCoverage::XMLParser parser(this->CTest, this->Coverage);
cmParseCoberturaCoverage::XMLParser parser(this->CTest, this->Coverage);
parser.ParseFile(xmlFile);
return true;
}

View File

@ -10,8 +10,8 @@
See the License for more information.
============================================================================*/
#ifndef cmParsePythonCoverage_h
#define cmParsePythonCoverage_h
#ifndef cmParseCoberturaCoverage_h
#define cmParseCoberturaCoverage_h
#include "cmStandardIncludes.h"
#include "cmCTestCoverageHandler.h"
@ -25,13 +25,13 @@
* Java-based Cobertura coverage application. This helper class parses
* that XML file to fill the coverage-handler container.
*/
class cmParsePythonCoverage
class cmParseCoberturaCoverage
{
public:
//! Create the coverage parser by passing in the coverage handler
//! container and the cmCTest object
cmParsePythonCoverage(cmCTestCoverageHandlerContainer& cont,
cmParseCoberturaCoverage(cmCTestCoverageHandlerContainer& cont,
cmCTest* ctest);
//! Read the XML produced by running `coverage xml`