tests: fix subprocess cleanup when dying
authorBartosz Golaszewski <bartekgola@gmail.com>
Thu, 15 Jun 2017 06:31:49 +0000 (08:31 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Thu, 15 Jun 2017 06:31:49 +0000 (08:31 +0200)
commit2a983631b73cd6bc599ec4bc7bfeb672d6126ac8
treecf4e641e3d3f222bd90b65c7865b7f5c87f1a6e5
parent05a6748bd137031d517b088851ee346193809963
tests: fix subprocess cleanup when dying

We need to kill the tool subprocess when bailing out during tests
everytime, not only when an error during test_tool_wait() occurs.

Also: we need to wait() for killed processes too as otherwise we may
end up calling delete_module() before the process actually stops using
gpio-mockup giving us a nasty error message from libkmod and leaving
the module in memory.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
tests/gpiod-test.c