summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestLaunchReporter.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-01-25 15:52:01 (GMT)
committerBrad King <brad.king@kitware.com>2024-01-25 15:53:04 (GMT)
commit151601c2e3419bd65bb276e77588c551487b4744 (patch)
tree6fef8b57dd7aa10c9f15447b18dc74951de68dad /Source/CTest/cmCTestLaunchReporter.cxx
parent23747f705602cbc47672c6db6716afbe8b5b013e (diff)
parentbcbb212df704d36736731aa567b291fd97401804 (diff)
downloadCMake-151601c2e3419bd65bb276e77588c551487b4744.zip
CMake-151601c2e3419bd65bb276e77588c551487b4744.tar.gz
CMake-151601c2e3419bd65bb276e77588c551487b4744.tar.bz2
Merge topic 'revert-replace-cmsysprocess-with-cmuvprocesschain' into release-3.28
bcbb212df7 Revert use of libuv for process execution for 3.28 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9176
Diffstat (limited to 'Source/CTest/cmCTestLaunchReporter.cxx')
-rw-r--r--Source/CTest/cmCTestLaunchReporter.cxx50
1 files changed, 30 insertions, 20 deletions
diff --git a/Source/CTest/cmCTestLaunchReporter.cxx b/Source/CTest/cmCTestLaunchReporter.cxx
index 4b4e5c5..149ba5d 100644
--- a/Source/CTest/cmCTestLaunchReporter.cxx
+++ b/Source/CTest/cmCTestLaunchReporter.cxx
@@ -2,9 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCTestLaunchReporter.h"
-#include <utility>
-
#include "cmsys/FStream.hxx"
+#include "cmsys/Process.h"
#include "cmsys/RegularExpression.hxx"
#include "cmCryptoHash.h"
@@ -23,7 +22,6 @@
cmCTestLaunchReporter::cmCTestLaunchReporter()
{
this->Passthru = true;
- this->Status.Finished = true;
this->ExitCode = 1;
this->CWD = cmSystemTools::GetCurrentWorkingDirectory();
@@ -233,23 +231,35 @@ void cmCTestLaunchReporter::WriteXMLResult(cmXMLElement& e2)
// ExitCondition
cmXMLElement e4(e3, "ExitCondition");
- if (this->Status.Finished) {
- auto exception = this->Status.GetException();
- switch (exception.first) {
- case cmUVProcessChain::ExceptionCode::None:
- e4.Content(this->ExitCode);
- break;
- case cmUVProcessChain::ExceptionCode::Spawn:
- e4.Content("Error administrating child process: ");
- e4.Content(exception.second);
- break;
- default:
- e4.Content("Terminated abnormally: ");
- e4.Content(exception.second);
- break;
- }
- } else {
- e4.Content("Killed when timeout expired");
+ cmsysProcess* cp = this->Process;
+ switch (cmsysProcess_GetState(cp)) {
+ case cmsysProcess_State_Starting:
+ e4.Content("No process has been executed");
+ break;
+ case cmsysProcess_State_Executing:
+ e4.Content("The process is still executing");
+ break;
+ case cmsysProcess_State_Disowned:
+ e4.Content("Disowned");
+ break;
+ case cmsysProcess_State_Killed:
+ e4.Content("Killed by parent");
+ break;
+
+ case cmsysProcess_State_Expired:
+ e4.Content("Killed when timeout expired");
+ break;
+ case cmsysProcess_State_Exited:
+ e4.Content(this->ExitCode);
+ break;
+ case cmsysProcess_State_Exception:
+ e4.Content("Terminated abnormally: ");
+ e4.Content(cmsysProcess_GetExceptionString(cp));
+ break;
+ case cmsysProcess_State_Error:
+ e4.Content("Error administrating child process: ");
+ e4.Content(cmsysProcess_GetErrorString(cp));
+ break;
}
}