diff options
author | Brad King <brad.king@kitware.com> | 2016-02-26 15:31:30 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-02-26 15:31:30 (GMT) |
commit | 467f83d2e5b215dba49901ceb1de53895fbfe6a7 (patch) | |
tree | 39580fb0f4d6d4ad6bec39d6184c490c42554eb7 | |
parent | 79d4b5bec911f057c87dd6c558cbe112afbc3a7e (diff) | |
parent | bc29ed542bbe8ff6b0bc178a7940a166680e002e (diff) | |
download | CMake-467f83d2e5b215dba49901ceb1de53895fbfe6a7.zip CMake-467f83d2e5b215dba49901ceb1de53895fbfe6a7.tar.gz CMake-467f83d2e5b215dba49901ceb1de53895fbfe6a7.tar.bz2 |
Merge topic 'fix_coverage_file_searching'
bc29ed54 CTest: Make coverage file selection more specific.
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 2c2cd48..fd62696 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -983,7 +983,7 @@ int cmCTestCoverageHandler::HandleDelphiCoverage( std::string BinDir = this->CTest->GetBinaryDir(); - std::string coverageFile = BinDir+ "/*.html"; + std::string coverageFile = BinDir+ "/*(*.pas).html"; g.FindFiles(coverageFile); @@ -1017,9 +1017,25 @@ int cmCTestCoverageHandler::HandleBlanketJSCoverage( std::string coverageFile = SourceDir+ "/*.json"; cmsys::Glob g; std::vector<std::string> files; + std::vector<std::string> blanketFiles; g.FindFiles(coverageFile); files=g.GetFiles(); - if (!files.empty()) + // Ensure that the JSON files found are the result of the + // Blanket.js output. Check for the "node-jscoverage" + // string on the second line + std::string line; + for(unsigned int fileEntry=0;fileEntry<files.size();fileEntry++) + { + cmsys::ifstream in(files[fileEntry].c_str()); + cmSystemTools::GetLineFromStream(in, line); + cmSystemTools::GetLineFromStream(in, line); + if (line.find("node-jscoverage") != line.npos) + { + blanketFiles.push_back(files[fileEntry]); + } + } + // Take all files with the node-jscoverage string and parse those + if (!blanketFiles.empty()) { cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Found BlanketJS output JSON, Performing Coverage" << std::endl, |