| 1071 | } |
| 1072 | |
| 1073 | bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput( |
| 1074 | std::string const& str, std::string& log, std::vector<int>& results) |
| 1075 | { |
| 1076 | log.clear(); |
| 1077 | auto sttime = std::chrono::steady_clock::now(); |
| 1078 | std::vector<std::string> lines; |
| 1079 | cmsys::SystemTools::Split(str, lines); |
| 1080 | cmCTestOptionalLog(this->CTest, DEBUG, |
| 1081 | "Start test: " << lines.size() << std::endl, this->Quiet); |
| 1082 | std::vector<std::string>::size_type cc; |
| 1083 | for (cc = 0; cc < lines.size(); cc++) { |
| 1084 | if (lines[cc] == BOUNDS_CHECKER_MARKER) { |
| 1085 | break; |
| 1086 | } |
| 1087 | } |
| 1088 | cmBoundsCheckerParser parser(this->CTest); |
| 1089 | parser.InitializeParser(); |
| 1090 | if (cc < lines.size()) { |
| 1091 | for (cc++; cc < lines.size(); ++cc) { |
| 1092 | std::string& theLine = lines[cc]; |
| 1093 | // check for command line arguments that are not escaped |
| 1094 | // correctly by BC |
| 1095 | if (theLine.find("TargetArgs=") != std::string::npos) { |
| 1096 | // skip this because BC gets it wrong and we can't parse it |
| 1097 | } else if (!parser.ParseChunk(theLine.c_str(), theLine.size())) { |
| 1098 | cmCTestLog(this->CTest, ERROR_MESSAGE, |
| 1099 | "Error in ParseChunk: " << theLine << std::endl); |
| 1100 | } |
| 1101 | } |
| 1102 | } |
| 1103 | int defects = 0; |
| 1104 | for (int err : parser.Errors) { |
| 1105 | results[err]++; |
| 1106 | defects++; |
| 1107 | } |
| 1108 | cmCTestOptionalLog(this->CTest, DEBUG, |
| 1109 | "End test (elapsed: " |
| 1110 | << cmDurationTo<unsigned int>( |
| 1111 | std::chrono::steady_clock::now() - sttime) |
| 1112 | << "s)" << std::endl, |
| 1113 | this->Quiet); |
| 1114 | if (defects) { |
| 1115 | // only put the output of Bounds Checker if there were |
| 1116 | // errors or leaks detected |
| 1117 | log = parser.Log; |
| 1118 | } |
| 1119 | this->DefectCount += defects; |
| 1120 | return defects == 0; |
| 1121 | } |
| 1122 | |
| 1123 | bool cmCTestMemCheckHandler::ProcessMemCheckCudaOutput( |
| 1124 | std::string const& str, std::string& log, std::vector<int>& results) |
no test coverage detected