summaryrefslogtreecommitdiff
path: root/Source/CTest/cmCTestBuildHandler.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CTest/cmCTestBuildHandler.cxx')
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx44
1 files changed, 31 insertions, 13 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 35c2b11188..103dc1ed85 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -14,11 +14,13 @@
#include "cmsys/Process.h"
#include "cmCTest.h"
+#include "cmCTestLaunchReporter.h"
#include "cmDuration.h"
#include "cmFileTimeCache.h"
#include "cmGeneratedFileStream.h"
#include "cmMakefile.h"
#include "cmProcessOutput.h"
+#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmStringReplaceHelper.h"
#include "cmSystemTools.h"
@@ -248,13 +250,14 @@ void cmCTestBuildHandler::PopulateCustomVectors(cmMakefile* mf)
}
// Record the user-specified custom warning rules.
- if (const char* customWarningMatchers =
+ if (cmProp customWarningMatchers =
mf->GetDefinition("CTEST_CUSTOM_WARNING_MATCH")) {
- cmExpandList(customWarningMatchers, this->ReallyCustomWarningMatches);
+ cmExpandList(*customWarningMatchers, this->ReallyCustomWarningMatches);
}
- if (const char* customWarningExceptions =
+ if (cmProp customWarningExceptions =
mf->GetDefinition("CTEST_CUSTOM_WARNING_EXCEPTION")) {
- cmExpandList(customWarningExceptions, this->ReallyCustomWarningExceptions);
+ cmExpandList(*customWarningExceptions,
+ this->ReallyCustomWarningExceptions);
}
}
@@ -885,15 +888,29 @@ int cmCTestBuildHandler::RunMakeCommand(const std::string& command,
if (*retVal) {
// If there was an error running command, report that on the
// dashboard.
- cmCTestBuildErrorWarning errorwarning;
- errorwarning.LogLine = 1;
- errorwarning.Text = cmStrCat(
- "*** WARNING non-zero return value in ctest from: ", argv[0]);
- errorwarning.PreContext.clear();
- errorwarning.PostContext.clear();
- errorwarning.Error = false;
- this->ErrorsAndWarnings.push_back(std::move(errorwarning));
- this->TotalWarnings++;
+ if (this->UseCTestLaunch) {
+ cmCTestLaunchReporter reporter;
+ reporter.RealArgs = args;
+ reporter.ComputeFileNames();
+ reporter.ExitCode = *retVal;
+ reporter.Process = cp;
+ // Use temporary BuildLog file to populate this error for CDash.
+ ofs.flush();
+ reporter.LogOut = this->LogFileNames["Build"];
+ reporter.LogOut += ".tmp";
+ reporter.WriteXML();
+ } else {
+ cmCTestBuildErrorWarning errorwarning;
+ errorwarning.LineNumber = 0;
+ errorwarning.LogLine = 1;
+ errorwarning.Text = cmStrCat(
+ "*** WARNING non-zero return value in ctest from: ", argv[0]);
+ errorwarning.PreContext.clear();
+ errorwarning.PostContext.clear();
+ errorwarning.Error = false;
+ this->ErrorsAndWarnings.push_back(std::move(errorwarning));
+ this->TotalWarnings++;
+ }
}
}
} else if (result == cmsysProcess_State_Exception) {
@@ -909,6 +926,7 @@ int cmCTestBuildHandler::RunMakeCommand(const std::string& command,
} else if (result == cmsysProcess_State_Error) {
// If there was an error running command, report that on the dashboard.
cmCTestBuildErrorWarning errorwarning;
+ errorwarning.LineNumber = 0;
errorwarning.LogLine = 1;
errorwarning.Text =
cmStrCat("*** ERROR executing: ", cmsysProcess_GetErrorString(cp));