diff options
author | David Cole <david.cole@kitware.com> | 2008-07-31 15:28:45 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2008-07-31 15:28:45 (GMT) |
commit | f059ebff692930572562ad03df17ca8e3f686ef9 (patch) | |
tree | 7668bcc4e8c64b8920bcf3d8817064646680dc6b /Source | |
parent | 26aa93d2cdf8391252a1c08d12e6f1b7bdca721a (diff) | |
download | CMake-f059ebff692930572562ad03df17ca8e3f686ef9.zip CMake-f059ebff692930572562ad03df17ca8e3f686ef9.tar.gz CMake-f059ebff692930572562ad03df17ca8e3f686ef9.tar.bz2 |
BUG: Fix issue #4971 - use lower case when comparing file names from gcov output on _WIN32 since sometimes the drive letters have different case.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 121b25f..2a4f27b 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -640,6 +640,18 @@ void cmCTestCoverageHandler::PopulateCustomVectors(cmMakefile *mf) } //---------------------------------------------------------------------- +// Fix for issue #4971 where the case of the drive letter component of +// the filenames might be different when analyzing gcov output. +// +// Compare file names: fnc(fn1) == fnc(fn2) // fnc == file name compare +// +#ifdef _WIN32 +#define fnc(s) cmSystemTools::LowerCase(s) +#else +#define fnc(s) s +#endif + +//---------------------------------------------------------------------- int cmCTestCoverageHandler::HandleGCovCoverage( cmCTestCoverageHandlerContainer* cont) { @@ -969,9 +981,11 @@ int cmCTestCoverageHandler::HandleGCovCoverage( if ( !sourceFile.empty() && actualSourceFile.empty() ) { gcovFile = ""; + // Is it in the source dir? if ( sourceFile.size() > cont->SourceDir.size() && - sourceFile.substr(0, cont->SourceDir.size()) == cont->SourceDir && + (fnc(sourceFile.substr(0, cont->SourceDir.size())) == + fnc(cont->SourceDir)) && sourceFile[cont->SourceDir.size()] == '/' ) { cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " produced s: " @@ -981,9 +995,11 @@ int cmCTestCoverageHandler::HandleGCovCoverage( actualSourceFile = cmSystemTools::CollapseFullPath(sourceFile.c_str()); } + // Binary dir? if ( sourceFile.size() > cont->BinaryDir.size() && - sourceFile.substr(0, cont->BinaryDir.size()) == cont->BinaryDir && + (fnc(sourceFile.substr(0, cont->BinaryDir.size())) == + fnc(cont->BinaryDir)) && sourceFile[cont->BinaryDir.size()] == '/' ) { cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " produced b: " @@ -993,6 +1009,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( actualSourceFile = cmSystemTools::CollapseFullPath(sourceFile.c_str()); } + if ( actualSourceFile.empty() ) { if ( missingFiles.find(actualSourceFile) == missingFiles.end() ) |