MCPcopy Create free account
hub / github.com/Kitware/CMake / ProcessSingleLine

Method ProcessSingleLine

Source/CTest/cmCTestBuildHandler.cxx:1157–1248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1155}
1156
1157int cmCTestBuildHandler::ProcessSingleLine(char const* data)
1158{
1159 if (this->UseCTestLaunch) {
1160 // No log scraping when using launchers.
1161 return b_REGULAR_LINE;
1162 }
1163
1164 // Ignore ANSI color codes when checking for errors and warnings.
1165 std::string input(data);
1166 std::string line;
1167 this->ColorRemover->Replace(input, line);
1168
1169 cmCTestOptionalLog(this->CTest, DEBUG, "Line: [" << line << "]" << std::endl,
1170 this->Quiet);
1171
1172 int warningLine = 0;
1173 int errorLine = 0;
1174
1175 // Check for regular expressions
1176
1177 if (!this->ErrorQuotaReached) {
1178 // Errors
1179 int wrxCnt = 0;
1180 for (cmsys::RegularExpression& rx : this->ErrorMatchRegex) {
1181 if (rx.find(line.c_str())) {
1182 errorLine = 1;
1183 cmCTestOptionalLog(this->CTest, DEBUG,
1184 " Error Line: " << line << " (matches: "
1185 << this->CustomErrorMatches[wrxCnt]
1186 << ")" << std::endl,
1187 this->Quiet);
1188 break;
1189 }
1190 wrxCnt++;
1191 }
1192 // Error exceptions
1193 wrxCnt = 0;
1194 for (cmsys::RegularExpression& rx : this->ErrorExceptionRegex) {
1195 if (rx.find(line.c_str())) {
1196 errorLine = 0;
1197 cmCTestOptionalLog(this->CTest, DEBUG,
1198 " Not an error Line: "
1199 << line << " (matches: "
1200 << this->CustomErrorExceptions[wrxCnt] << ")"
1201 << std::endl,
1202 this->Quiet);
1203 break;
1204 }
1205 wrxCnt++;
1206 }
1207 }
1208 if (!this->WarningQuotaReached) {
1209 // Warnings
1210 int wrxCnt = 0;
1211 for (cmsys::RegularExpression& rx : this->WarningMatchRegex) {
1212 if (rx.find(line.c_str())) {
1213 warningLine = 1;
1214 cmCTestOptionalLog(this->CTest, DEBUG,

Callers 1

ProcessBufferMethod · 0.95

Calls 3

c_strMethod · 0.80
ReplaceMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected