summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestTestHandler.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-05-11 17:32:15 (GMT)
committerBrad King <brad.king@kitware.com>2023-06-02 10:51:13 (GMT)
commit54c5654f7d530ea363b3fcc02f2176d79342c07b (patch)
tree23a2bd337eb22e827914dbbb9d631899bd78dd8e /Source/CTest/cmCTestTestHandler.h
parente38c05688ed637bdda8e6af5f2d76fc12bee35e3 (diff)
downloadCMake-54c5654f7d530ea363b3fcc02f2176d79342c07b.zip
CMake-54c5654f7d530ea363b3fcc02f2176d79342c07b.tar.gz
CMake-54c5654f7d530ea363b3fcc02f2176d79342c07b.tar.bz2
ctest: Optionally terminate tests with a custom signal on timeout
CTest normally terminates test processes on timeout using `SIGKILL`. Offer tests a chance to exit gracefully, on platforms supporting POSIX signals, by setting `TIMEOUT_SIGNAL_{NAME,GRACE_PERIOD}` properties. Fixes: #17288
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.h')
-rw-r--r--Source/CTest/cmCTestTestHandler.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index b6bfde1..315a5b7 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -15,6 +15,7 @@
#include <vector>
#include <cm/optional>
+#include <cm/string_view>
#include "cmsys/RegularExpression.hxx"
@@ -119,8 +120,16 @@ public:
bool operator!=(const cmCTestTestResourceRequirement& other) const;
};
+ struct Signal
+ {
+ int Number = 0;
+ std::string Name;
+ };
+
struct cmCTestTestProperties
{
+ void AppendError(cm::string_view err);
+ cm::optional<std::string> Error;
std::string Name;
std::string Directory;
std::vector<std::string> Args;
@@ -144,6 +153,8 @@ public:
int PreviousRuns = 0;
bool RunSerial = false;
cm::optional<cmDuration> Timeout;
+ cm::optional<Signal> TimeoutSignal;
+ cm::optional<cmDuration> TimeoutGracePeriod;
cmDuration AlternateTimeout;
int Index = 0;
// Requested number of process slots