diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2023-07-26 20:58:34 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2023-08-29 14:51:30 (GMT) |
commit | 96b3dd329ecdecdf2110cab4bc368690a630e012 (patch) | |
tree | 31cb0510192cfce573a400b517299b56c6db6476 /Source/CTest/cmCTestLaunchReporter.cxx | |
parent | b15ad7ebb6b96630396fb54b4679075a52c5f79b (diff) | |
download | CMake-96b3dd329ecdecdf2110cab4bc368690a630e012.zip CMake-96b3dd329ecdecdf2110cab4bc368690a630e012.tar.gz CMake-96b3dd329ecdecdf2110cab4bc368690a630e012.tar.bz2 |
cmCTestLaunchReporter: Replace cmsysProcess with cmUVProcessChain
And convert cmCTestLaunch and cmCTestBuildHandler too.
Diffstat (limited to 'Source/CTest/cmCTestLaunchReporter.cxx')
-rw-r--r-- | Source/CTest/cmCTestLaunchReporter.cxx | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/Source/CTest/cmCTestLaunchReporter.cxx b/Source/CTest/cmCTestLaunchReporter.cxx index 149ba5d..4b4e5c5 100644 --- a/Source/CTest/cmCTestLaunchReporter.cxx +++ b/Source/CTest/cmCTestLaunchReporter.cxx @@ -2,8 +2,9 @@ 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" @@ -22,6 +23,7 @@ cmCTestLaunchReporter::cmCTestLaunchReporter() { this->Passthru = true; + this->Status.Finished = true; this->ExitCode = 1; this->CWD = cmSystemTools::GetCurrentWorkingDirectory(); @@ -231,35 +233,23 @@ void cmCTestLaunchReporter::WriteXMLResult(cmXMLElement& e2) // ExitCondition cmXMLElement e4(e3, "ExitCondition"); - 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; + 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"); } } |