tests: Properly report skipped tests

We were calling exit(0) when tests were skipped, which counted
them as passed instead of skipped. Fix this by properly exiting
with 77 (which is what automake expects for skipped tests) from
the tests themselves, then returning 77 again from weston-test-runner
if all the tests were skipped. Finally the weston-test.so module
catches weston-test-runner's exit code and uses it as an exit code,
which is what automake will see and use.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
diff --git a/tests/weston-test.c b/tests/weston-test.c
index 844059d..35ccaa4 100644
--- a/tests/weston-test.c
+++ b/tests/weston-test.c
@@ -54,6 +54,12 @@
 	struct weston_test *test =
 		container_of(process, struct weston_test, process);
 
+	/* Chain up from weston-test-runner's exit code so that automake
+	 * knows the exit status and can report e.g. skipped tests. */
+	if (WIFEXITED(status) && WEXITSTATUS(status) != 0)
+		exit(WEXITSTATUS(status));
+
+	/* In case the child aborted or segfaulted... */
 	assert(status == 0);
 
 	wl_display_terminate(test->compositor->wl_display);