check: Catch SIGTERM and SIGINT in the test runner and kill all currently running...
authorSebastian Dröge <sebastian@centricular.com>
Sat, 21 Mar 2015 14:19:43 +0000 (15:19 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 21 Mar 2015 14:19:43 +0000 (15:19 +0100)
commit7646cef644af79d55635c80773948771768d17ff
treee86f46909f4966c14de57f420595d50724f167a3
parent6a6188a82f671032bf1c9ce3dd66310075cf4197
check: Catch SIGTERM and SIGINT in the test runner and kill all currently running tests

Otherwise e.g. ctrl+c in the test runner exits the test runner, while the test
itself is still running in the background, uses CPU and memory and potentially
never exits (e.g. if the test ran into a deadlock or infinite loop).

The reason why we have to manually kill the actual tests is that after
forking they will be moved to their own process group, and as such are
not receiving any signals sent to the test runner anymore. This is supposed
to be done to make it easier to kill a test, which it only really does if
the test itself is forking off new processes.

This fix is not complete though. SIGKILL can't be caught at all, and error
signals like SIGSEGV, SIGFPE are currently not caught. The latter will only
happen if there is a bug in the test runner itself, and as such seem less
important.
libs/gst/check/libcheck/check_run.c