summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorZack Galbreath <zack.galbreath@kitware.com>2020-09-24 17:41:15 (GMT)
committerZack Galbreath <zack.galbreath@kitware.com>2020-09-28 17:13:52 (GMT)
commitab9ad2a6a0addcb1366b68c0a28df7e1c9c9bc6f (patch)
tree468f7042c85c95f9b0b5c39b27094b9fd4facae1 /Source/CTest
parent56e4e942d22bddc1662d5a3d057ab8246b805c32 (diff)
downloadCMake-ab9ad2a6a0addcb1366b68c0a28df7e1c9c9bc6f.zip
CMake-ab9ad2a6a0addcb1366b68c0a28df7e1c9c9bc6f.tar.gz
CMake-ab9ad2a6a0addcb1366b68c0a28df7e1c9c9bc6f.tar.bz2
ctest: report make-level errors to CDash when using launchers
Fixes: #19545
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx32
-rw-r--r--Source/CTest/cmCTestGenericHandler.cxx3
-rw-r--r--Source/CTest/cmCTestGenericHandler.h1
3 files changed, 27 insertions, 9 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 9997548..bb700eba 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -14,6 +14,7 @@
#include "cmsys/Process.h"
#include "cmCTest.h"
+#include "cmCTestLaunchReporter.h"
#include "cmDuration.h"
#include "cmFileTimeCache.h"
#include "cmGeneratedFileStream.h"
@@ -887,15 +888,28 @@ 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.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) {
diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx
index a71f550..91818bb 100644
--- a/Source/CTest/cmCTestGenericHandler.cxx
+++ b/Source/CTest/cmCTestGenericHandler.cxx
@@ -6,6 +6,7 @@
#include <utility>
#include "cmCTest.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
cmCTestGenericHandler::cmCTestGenericHandler()
@@ -122,6 +123,8 @@ bool cmCTestGenericHandler::StartLogFile(const char* name,
ostr << "_" << this->CTest->GetCurrentTag();
}
ostr << ".log";
+ this->LogFileNames[name] =
+ cmStrCat(this->CTest->GetBinaryDir(), "/Testing/Temporary/", ostr.str());
if (!this->CTest->OpenOutputFile("Temporary", ostr.str(), xofs)) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot create log file: " << ostr.str() << std::endl);
diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h
index 591d9cd..89d7596 100644
--- a/Source/CTest/cmCTestGenericHandler.h
+++ b/Source/CTest/cmCTestGenericHandler.h
@@ -100,6 +100,7 @@ protected:
cmCTest* CTest;
t_StringToString Options;
t_StringToString PersistentOptions;
+ t_StringToString LogFileNames;
cmCTestCommand* Command;
int SubmitIndex;