unit-tests: Invoke all registered thread cleanup handlers on test failure
authorMartin Willi <martin@revosec.ch>
Tue, 14 Apr 2015 06:59:58 +0000 (08:59 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 15 Apr 2015 12:38:43 +0000 (14:38 +0200)
commit30003bc51ad230663e329aea259784bbbaf3b865
tree41a1403adf99546aeabd851a79d3614833ad1200
parentd36b30803e2ca313339b44e181efa46c925b51b8
unit-tests: Invoke all registered thread cleanup handlers on test failure

If a test fails in a timeout or a test failure, longjmp() is used to restore
the thread context and handle test failure. However, there might be unreleased
resources, namely locks, which prevent the library to clean up properly after
finishing the test.

By using thread cleanup handlers, we can release any test subject internal or
test specific external resources on test failure. We do so by calling all
registered cleanup handlers.
src/libstrongswan/tests/test_runner.c