Pass Ctrl+C signal from ctest to test programs.

My situation is exactly like https://cmake.org/pipermail/cmake/2014-August/058437.html.

I want to run some clean up when signals like SIGTERM are received. When I run the test manually and press Ctrl+C, the signal is handled correctly and cleans up as expected. With ctest, this is not the case and it seems ctest is not sending the signals to the test program.

Although this is not exactly what you want, I wonder if the signaling enabled recently could be further adapted to your needs.
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8472/diffs

Thank you!

Yeah it’s close, but it can only be used when the test program times out, so not sure it can be applied in my case, since this one involves catching signals sent to ctest.

Also, looks like it’s something that has bothered a couple of people before now: