Commit a2822d30 authored by Joe Snyder's avatar Joe Snyder
Browse files

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.
parent 0ee116b7
......@@ -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
......
......@@ -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());
......
......@@ -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);
......
#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;
}
......@@ -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`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment