summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmParseGTMCoverage.cxx
diff options
context:
space:
mode:
authorJoseph Snyder <joe.snyder@kitware.com>2018-10-15 13:57:42 (GMT)
committerBrad King <brad.king@kitware.com>2018-10-16 14:59:09 (GMT)
commitf7d92deff487810f21b4f7979a5fe1892fabd255 (patch)
treeab8410cdfb8dbf0e1c8de77f6527dc23fdf438c6 /Source/CTest/cmParseGTMCoverage.cxx
parent6c281138a577ccf07ae71b1286df30a3d22746e0 (diff)
downloadCMake-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.cxx9
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]);
}
}