|
@@ -10,6 +10,7 @@
|
|
|
#include "cmMakefile.h"
|
|
#include "cmMakefile.h"
|
|
|
#include "cmProcessOutput.h"
|
|
#include "cmProcessOutput.h"
|
|
|
#include "cmStringAlgorithms.h"
|
|
#include "cmStringAlgorithms.h"
|
|
|
|
|
+#include "cmStringReplaceHelper.h"
|
|
|
#include "cmSystemTools.h"
|
|
#include "cmSystemTools.h"
|
|
|
#include "cmXMLWriter.h"
|
|
#include "cmXMLWriter.h"
|
|
|
|
|
|
|
@@ -408,6 +409,9 @@ int cmCTestBuildHandler::ProcessHandler()
|
|
|
// Remember start build time
|
|
// Remember start build time
|
|
|
this->StartBuild = this->CTest->CurrentTime();
|
|
this->StartBuild = this->CTest->CurrentTime();
|
|
|
this->StartBuildTime = std::chrono::system_clock::now();
|
|
this->StartBuildTime = std::chrono::system_clock::now();
|
|
|
|
|
+
|
|
|
|
|
+ cmStringReplaceHelper colorRemover("\x1b\\[[0-9;]*m", "", nullptr);
|
|
|
|
|
+ this->ColorRemover = &colorRemover;
|
|
|
int retVal = 0;
|
|
int retVal = 0;
|
|
|
int res = cmsysProcess_State_Exited;
|
|
int res = cmsysProcess_State_Exited;
|
|
|
if (!this->CTest->GetShowOnly()) {
|
|
if (!this->CTest->GetShowOnly()) {
|
|
@@ -1077,7 +1081,12 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data)
|
|
|
return b_REGULAR_LINE;
|
|
return b_REGULAR_LINE;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- cmCTestOptionalLog(this->CTest, DEBUG, "Line: [" << data << "]" << std::endl,
|
|
|
|
|
|
|
+ // Ignore ANSI color codes when checking for errors and warnings.
|
|
|
|
|
+ std::string input(data);
|
|
|
|
|
+ std::string line;
|
|
|
|
|
+ this->ColorRemover->Replace(input, line);
|
|
|
|
|
+
|
|
|
|
|
+ cmCTestOptionalLog(this->CTest, DEBUG, "Line: [" << line << "]" << std::endl,
|
|
|
this->Quiet);
|
|
this->Quiet);
|
|
|
|
|
|
|
|
int warningLine = 0;
|
|
int warningLine = 0;
|
|
@@ -1089,10 +1098,10 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data)
|
|
|
// Errors
|
|
// Errors
|
|
|
int wrxCnt = 0;
|
|
int wrxCnt = 0;
|
|
|
for (cmsys::RegularExpression& rx : this->ErrorMatchRegex) {
|
|
for (cmsys::RegularExpression& rx : this->ErrorMatchRegex) {
|
|
|
- if (rx.find(data)) {
|
|
|
|
|
|
|
+ if (rx.find(line.c_str())) {
|
|
|
errorLine = 1;
|
|
errorLine = 1;
|
|
|
cmCTestOptionalLog(this->CTest, DEBUG,
|
|
cmCTestOptionalLog(this->CTest, DEBUG,
|
|
|
- " Error Line: " << data << " (matches: "
|
|
|
|
|
|
|
+ " Error Line: " << line << " (matches: "
|
|
|
<< this->CustomErrorMatches[wrxCnt]
|
|
<< this->CustomErrorMatches[wrxCnt]
|
|
|
<< ")" << std::endl,
|
|
<< ")" << std::endl,
|
|
|
this->Quiet);
|
|
this->Quiet);
|
|
@@ -1103,11 +1112,11 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data)
|
|
|
// Error exceptions
|
|
// Error exceptions
|
|
|
wrxCnt = 0;
|
|
wrxCnt = 0;
|
|
|
for (cmsys::RegularExpression& rx : this->ErrorExceptionRegex) {
|
|
for (cmsys::RegularExpression& rx : this->ErrorExceptionRegex) {
|
|
|
- if (rx.find(data)) {
|
|
|
|
|
|
|
+ if (rx.find(line.c_str())) {
|
|
|
errorLine = 0;
|
|
errorLine = 0;
|
|
|
cmCTestOptionalLog(this->CTest, DEBUG,
|
|
cmCTestOptionalLog(this->CTest, DEBUG,
|
|
|
" Not an error Line: "
|
|
" Not an error Line: "
|
|
|
- << data << " (matches: "
|
|
|
|
|
|
|
+ << line << " (matches: "
|
|
|
<< this->CustomErrorExceptions[wrxCnt] << ")"
|
|
<< this->CustomErrorExceptions[wrxCnt] << ")"
|
|
|
<< std::endl,
|
|
<< std::endl,
|
|
|
this->Quiet);
|
|
this->Quiet);
|
|
@@ -1120,11 +1129,11 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data)
|
|
|
// Warnings
|
|
// Warnings
|
|
|
int wrxCnt = 0;
|
|
int wrxCnt = 0;
|
|
|
for (cmsys::RegularExpression& rx : this->WarningMatchRegex) {
|
|
for (cmsys::RegularExpression& rx : this->WarningMatchRegex) {
|
|
|
- if (rx.find(data)) {
|
|
|
|
|
|
|
+ if (rx.find(line.c_str())) {
|
|
|
warningLine = 1;
|
|
warningLine = 1;
|
|
|
cmCTestOptionalLog(this->CTest, DEBUG,
|
|
cmCTestOptionalLog(this->CTest, DEBUG,
|
|
|
" Warning Line: "
|
|
" Warning Line: "
|
|
|
- << data << " (matches: "
|
|
|
|
|
|
|
+ << line << " (matches: "
|
|
|
<< this->CustomWarningMatches[wrxCnt] << ")"
|
|
<< this->CustomWarningMatches[wrxCnt] << ")"
|
|
|
<< std::endl,
|
|
<< std::endl,
|
|
|
this->Quiet);
|
|
this->Quiet);
|
|
@@ -1136,11 +1145,11 @@ int cmCTestBuildHandler::ProcessSingleLine(const char* data)
|
|
|
wrxCnt = 0;
|
|
wrxCnt = 0;
|
|
|
// Warning exceptions
|
|
// Warning exceptions
|
|
|
for (cmsys::RegularExpression& rx : this->WarningExceptionRegex) {
|
|
for (cmsys::RegularExpression& rx : this->WarningExceptionRegex) {
|
|
|
- if (rx.find(data)) {
|
|
|
|
|
|
|
+ if (rx.find(line.c_str())) {
|
|
|
warningLine = 0;
|
|
warningLine = 0;
|
|
|
cmCTestOptionalLog(this->CTest, DEBUG,
|
|
cmCTestOptionalLog(this->CTest, DEBUG,
|
|
|
" Not a warning Line: "
|
|
" Not a warning Line: "
|
|
|
- << data << " (matches: "
|
|
|
|
|
|
|
+ << line << " (matches: "
|
|
|
<< this->CustomWarningExceptions[wrxCnt] << ")"
|
|
<< this->CustomWarningExceptions[wrxCnt] << ")"
|
|
|
<< std::endl,
|
|
<< std::endl,
|
|
|
this->Quiet);
|
|
this->Quiet);
|