summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestCoverageHandler.cxx
diff options
context:
space:
mode:
authorJoseph Snyder <joe.snyder@kitware.com>2014-09-29 18:52:10 (GMT)
committerBrad King <brad.king@kitware.com>2014-10-21 19:02:20 (GMT)
commit5c31c3e4eb36cccaaf72d0f0582beed98f6665e0 (patch)
tree2bd146d57c42f54cf891de956bb55aa04be056a4 /Source/CTest/cmCTestCoverageHandler.cxx
parent453f20d89381d8d5c2e7afb91559c754dc03910e (diff)
downloadCMake-5c31c3e4eb36cccaaf72d0f0582beed98f6665e0.zip
CMake-5c31c3e4eb36cccaaf72d0f0582beed98f6665e0.tar.gz
CMake-5c31c3e4eb36cccaaf72d0f0582beed98f6665e0.tar.bz2
CTest: Add code coverage parser for Pascal/Delphi
Add a class to parse the HTML output of the Delphi-code-coverage tool http://code.google.com/p/delphi-code-coverage/ Add a test for the new parser.
Diffstat (limited to 'Source/CTest/cmCTestCoverageHandler.cxx')
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx36
1 files changed, 36 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 76f6584..d921705 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -15,6 +15,7 @@
#include "cmParseGTMCoverage.h"
#include "cmParseCacheCoverage.h"
#include "cmParseJacocoCoverage.h"
+#include "cmParseDelphiCoverage.h"
#include "cmCTest.h"
#include "cmake.h"
#include "cmMakefile.h"
@@ -423,6 +424,12 @@ int cmCTestCoverageHandler::ProcessHandler()
return error;
}
+ file_count += this->HandleDelphiCoverage(&cont);
+ error = cont.Error;
+ if ( file_count < 0 )
+ {
+ return error;
+ }
std::set<std::string> uncovered = this->FindUncoveredFiles(&cont);
if ( file_count == 0 )
@@ -910,7 +917,36 @@ int cmCTestCoverageHandler::HandleJacocoCoverage(
return static_cast<int>(cont->TotalCoverage.size());
}
+//----------------------------------------------------------------------
+int cmCTestCoverageHandler::HandleDelphiCoverage(
+ cmCTestCoverageHandlerContainer* cont)
+{
+ cmParseDelphiCoverage cov =
+ cmParseDelphiCoverage(*cont, this->CTest);
+ cmsys::Glob g;
+ std::vector<std::string> files;
+ g.SetRecurse(true);
+
+ std::string BinDir
+ = this->CTest->GetBinaryDir();
+ std::string coverageFile = BinDir+ "/*.html";
+ g.FindFiles(coverageFile);
+ files=g.GetFiles();
+ if (files.size() > 0)
+ {
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "Found Delphi HTML Files, Performing Coverage" << std::endl);
+ cov.LoadCoverageData(files);
+ }
+ else
+ {
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ " Cannot find Delphi coverage files: " << coverageFile
+ << std::endl);
+ }
+ return static_cast<int>(cont->TotalCoverage.size());
+}
//----------------------------------------------------------------------
int cmCTestCoverageHandler::HandleGCovCoverage(
cmCTestCoverageHandlerContainer* cont)