libnm-glib: make test-networkmanager-service.py automatically exit with its parent
authorDan Winship <danw@gnome.org>
Thu, 31 Jul 2014 18:00:22 +0000 (14:00 -0400)
committerDan Winship <danw@gnome.org>
Fri, 1 Aug 2014 16:12:42 +0000 (12:12 -0400)
commit08b91199fb95d9178feaeaa58381847332f22ad8
tree9cc7c3ab8c111ad8d8f5662d1220c52c3b553922
parentbd8a7f74b1f7d9b1712741797096bf97ef5df9aa
libnm-glib: make test-networkmanager-service.py automatically exit with its parent

test-nm-client.c and test-remote-settings-client.c were using their
own assertion macros so they could kill the test service on assertion
failure. Except that some new code didn't get the memo and used the
g_assert* macros. Not to mention that sometimes the tests would crash
outside of an assertion macro.

We can make test-networkmanager-service.py notice that its parent has
crashed by opening a pipe between them and taking advantage of the
fact that the pipe will be automatically closed if the parent crashes.
So then test-networkmanager-service.py just has to watch for that, and
exit if the pipe closes.

Then that lets us drop the test_assert* macros and just use g_assert*
instead.
libnm-glib/tests/common.c
libnm-glib/tests/common.h
libnm-glib/tests/test-nm-client.c
libnm-glib/tests/test-remote-settings-client.c
tools/test-networkmanager-service.py