88eefaced1
We extend the CTestTestTimeout test to check that when a test times out its children (grandchildren of ctest) are killed. Instead of running the timeout executable directly, we run it through a cmake script that redirects the timeout executable output to a file. A second test later runs and verifies that the timeout executable was unable to complete and write data to the log file. Only if the first inner test times out and the second inner test passes (log is empty) does the CTestTestTimeout test pass.
10 lines
307 B
CMake
10 lines
307 B
CMake
# Block just as long as timeout.cmake would if it were not killed.
|
|
execute_process(COMMAND ${Timeout})
|
|
|
|
# Verify that the log is empty, which indicates that the grandchild
|
|
# was killed before it finished sleeping.
|
|
file(READ "${Log}" LOG)
|
|
if(NOT "${LOG}" STREQUAL "")
|
|
message(FATAL_ERROR "${LOG}")
|
|
endif()
|