summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CTestTimeout/SignalWindows-check.cmake
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 /Tests/RunCMake/CTestTimeout/SignalWindows-check.cmake
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 'Tests/RunCMake/CTestTimeout/SignalWindows-check.cmake')
-rw-r--r--Tests/RunCMake/CTestTimeout/SignalWindows-check.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/Tests/RunCMake/CTestTimeout/SignalWindows-check.cmake b/Tests/RunCMake/CTestTimeout/SignalWindows-check.cmake
new file mode 100644
index 0000000..1bf7f8a
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeout/SignalWindows-check.cmake
@@ -0,0 +1,11 @@
+file(GLOB test_xml "${RunCMake_TEST_BINARY_DIR}/Testing/*/Test.xml")
+if(NOT test_xml)
+ set(RunCMake_TEST_FAILED "Test.xml not found.")
+ return()
+endif()
+
+file(READ "${test_xml}" test_xml_content)
+if(NOT test_xml_content MATCHES "TIMEOUT_SIGNAL_NAME is not supported on Windows\\.")
+ set(RunCMake_TEST_FAILED "Test output does not have expected error message.")
+ return()
+endif()