summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-05-28 16:34:38 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-05-28 16:34:38 (GMT)
commit574f096b9a2fc3ae420437eb29b61e8c7a22072f (patch)
treeb601589f3770ad93539d44b86b2eab78854f5919
parent8df4d03d99ba88394d931f41d679defdd226b193 (diff)
parentdeee7c42a2df8156ad81c371d0f1007286018f0f (diff)
downloadCMake-574f096b9a2fc3ae420437eb29b61e8c7a22072f.zip
CMake-574f096b9a2fc3ae420437eb29b61e8c7a22072f.tar.gz
CMake-574f096b9a2fc3ae420437eb29b61e8c7a22072f.tar.bz2
Merge topic 'fix-coverage-py'
deee7c42 CTest: Fix Python coverage.py off-by-one error in results 88b3dcb1 CTest: Improve Python coverage.py source file search algorithm
-rw-r--r--Source/CTest/cmParsePythonCoverage.cxx24
1 files changed, 15 insertions, 9 deletions
diff --git a/Source/CTest/cmParsePythonCoverage.cxx b/Source/CTest/cmParsePythonCoverage.cxx
index 2578bb8..817b8dc 100644
--- a/Source/CTest/cmParsePythonCoverage.cxx
+++ b/Source/CTest/cmParsePythonCoverage.cxx
@@ -33,19 +33,25 @@ protected:
<< atts[tagCount+1] << std::endl);
this->CurFileName = this->Coverage.SourceDir + "/" +
atts[tagCount+1];
- FileLinesType& curFileLines =
- this->Coverage.TotalCoverage[this->CurFileName];
cmsys::ifstream fin(this->CurFileName.c_str());
if(!fin)
{
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Python Coverage: Error opening " << this->CurFileName
- << std::endl);
- this->Coverage.Error++;
- break;
+ this->CurFileName = this->Coverage.BinaryDir + "/" +
+ atts[tagCount+1];
+ fin.open(this->CurFileName.c_str());
+ if (!fin)
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Python Coverage: Error opening " << this->CurFileName
+ << std::endl);
+ this->Coverage.Error++;
+ break;
+ }
}
std::string line;
+ FileLinesType& curFileLines =
+ this->Coverage.TotalCoverage[this->CurFileName];
curFileLines.push_back(-1);
while(cmSystemTools::GetLineFromStream(fin, line))
{
@@ -73,11 +79,11 @@ protected:
curNumber = atoi(atts[tagCount+1]);
}
- if(curHits > -1 && curNumber > -1)
+ if(curHits > -1 && curNumber > 0)
{
FileLinesType& curFileLines =
this->Coverage.TotalCoverage[this->CurFileName];
- curFileLines[curNumber] = curHits;
+ curFileLines[curNumber-1] = curHits;
break;
}
++tagCount;