summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestCoverageHandler.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-11-16 14:22:41 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-11-16 14:22:41 (GMT)
commit96be53aebd01e313634a0cf0c611c718fbccc1b6 (patch)
tree3f2fd9309842e5bcb04d683c0454cb8eb10f98c2 /Source/CTest/cmCTestCoverageHandler.cxx
parent64b3df7d1eabbd7c8af5262e68b3b729fc43cb22 (diff)
parent1db32ffe98272ded29827b833f373ffa399429e9 (diff)
downloadCMake-96be53aebd01e313634a0cf0c611c718fbccc1b6.zip
CMake-96be53aebd01e313634a0cf0c611c718fbccc1b6.tar.gz
CMake-96be53aebd01e313634a0cf0c611c718fbccc1b6.tar.bz2
Merge topic 'jacoco_out_of_source'
1db32ffe ctest_coverage: Search for Jacoco files in the binary directory
Diffstat (limited to 'Source/CTest/cmCTestCoverageHandler.cxx')
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx25
1 files changed, 21 insertions, 4 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 09902a1..6027502 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -913,16 +913,33 @@ int cmCTestCoverageHandler::HandleJacocoCoverage(
{
cmParseJacocoCoverage cov =
cmParseJacocoCoverage(*cont, this->CTest);
- cmsys::Glob g;
+
+ // Search in the source directory.
+ cmsys::Glob g1;
std::vector<std::string> files;
- g.SetRecurse(true);
+ g1.SetRecurse(true);
std::string SourceDir
= this->CTest->GetCTestConfiguration("SourceDirectory");
std::string coverageFile = SourceDir+ "/*jacoco.xml";
- g.FindFiles(coverageFile);
- files=g.GetFiles();
+ g1.FindFiles(coverageFile);
+ files = g1.GetFiles();
+
+ // ...and in the binary directory.
+ cmsys::Glob g2;
+ std::vector<std::string> binFiles;
+ g2.SetRecurse(true);
+ std::string binaryDir
+ = this->CTest->GetCTestConfiguration("BuildDirectory");
+ std::string binCoverageFile = binaryDir+ "/*jacoco.xml";
+ g2.FindFiles(binCoverageFile);
+ binFiles = g2.GetFiles();
+ if (!binFiles.empty())
+ {
+ files.insert(files.end(), binFiles.begin(), binFiles.end());
+ }
+
if (!files.empty())
{
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,