diff options
author | Joseph Snyder <joe.snyder@kitware.com> | 2018-10-15 13:57:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-10-16 14:59:09 (GMT) |
commit | f7d92deff487810f21b4f7979a5fe1892fabd255 (patch) | |
tree | ab8410cdfb8dbf0e1c8de77f6527dc23fdf438c6 /Source/CTest/cmParseGTMCoverage.cxx | |
parent | 6c281138a577ccf07ae71b1286df30a3d22746e0 (diff) | |
download | CMake-f7d92deff487810f21b4f7979a5fe1892fabd255.zip CMake-f7d92deff487810f21b4f7979a5fe1892fabd255.tar.gz CMake-f7d92deff487810f21b4f7979a5fe1892fabd255.tar.bz2 |
CTest: Fix GTM coverage handling of entry point named "%"
Removing the "%" character from the name of the routine in the line
parser causes CTest to be unable to find a routine entry point that is
only named "%". Instead leave it during line parsing and handle routine
names ending in "%" explicitly when loading files.
Diffstat (limited to 'Source/CTest/cmParseGTMCoverage.cxx')
-rw-r--r-- | Source/CTest/cmParseGTMCoverage.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx index 83dde3f..0722753 100644 --- a/Source/CTest/cmParseGTMCoverage.cxx +++ b/Source/CTest/cmParseGTMCoverage.cxx @@ -1,5 +1,6 @@ #include "cmParseGTMCoverage.h" +#include "cmAlgorithms.h" #include "cmCTest.h" #include "cmCTestCoverageHandler.h" #include "cmSystemTools.h" @@ -86,6 +87,10 @@ bool cmParseGTMCoverage::ReadMCovFile(const char* file) } // Find the full path to the file bool found = this->FindMumpsFile(routine, filepath); + if (!found && cmHasLiteralSuffix(routine, "%")) { + routine.erase(0, 1); + found = this->FindMumpsFile(routine, filepath); + } if (found) { int lineoffset = 0; if (this->FindFunctionInMumpsFile(filepath, function, lineoffset)) { @@ -192,8 +197,8 @@ bool cmParseGTMCoverage::ParseMCOVLine(std::string const& line, done = true; } } else { - // all chars except ", (, and % get stored in the arg string - if (cur != '\"' && cur != '(' && cur != '%') { + // all chars except " and ( get stored in the arg string + if (cur != '\"' && cur != '(') { arg.append(1, line[pos]); } } |