summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmProcess.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-05-10 15:30:48 (GMT)
committerBrad King <brad.king@kitware.com>2023-05-31 13:43:03 (GMT)
commite38c05688ed637bdda8e6af5f2d76fc12bee35e3 (patch)
treecf3297e8dba3a8f59252308b6e7b11a480bbca1b /Source/CTest/cmProcess.h
parent25c1468314c5f45b254067d882dfc042f9d1c63e (diff)
downloadCMake-e38c05688ed637bdda8e6af5f2d76fc12bee35e3.zip
CMake-e38c05688ed637bdda8e6af5f2d76fc12bee35e3.tar.gz
CMake-e38c05688ed637bdda8e6af5f2d76fc12bee35e3.tar.bz2
CTest/cmProcess: Adopt field tracking reason for the process timeout
A test process may timeout either because the test timeout was reached, or the overall stop time was reached. Shorten the lifetime for which we track this state in `cmCTestRunTest`.
Diffstat (limited to 'Source/CTest/cmProcess.h')
-rw-r--r--Source/CTest/cmProcess.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h
index 1578687..c80922d 100644
--- a/Source/CTest/cmProcess.h
+++ b/Source/CTest/cmProcess.h
@@ -41,6 +41,14 @@ public:
// Return true if the process starts
bool StartProcess(uv_loop_t& loop, std::vector<size_t>* affinity);
+ enum class TimeoutReason
+ {
+ Normal,
+ StopTime,
+ };
+ void SetTimeoutReason(TimeoutReason r) { this->TimeoutReason_ = r; }
+ TimeoutReason GetTimeoutReason() const { return this->TimeoutReason_; }
+
enum class State
{
Starting,
@@ -79,6 +87,7 @@ public:
private:
cm::optional<cmDuration> Timeout;
+ TimeoutReason TimeoutReason_ = TimeoutReason::Normal;
std::chrono::steady_clock::time_point StartTime;
cmDuration TotalTime;
bool ReadHandleClosed = false;