summaryrefslogtreecommitdiff
path: root/tests/weston-test.c
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2014-02-07 09:34:48 +0100
committerKristian Høgsberg <krh@bitplanet.net>2014-02-18 13:50:29 -0800
commitdae8a4b9c5c7fd94646527095a9f83a5f936eaa4 (patch)
treeaeaccfff8b748cb67620b5d0dab16ca5fb7bb905 /tests/weston-test.c
parent943cb120754ab1720410d8dfa35560e570a5944e (diff)
downloadweston-dae8a4b9c5c7fd94646527095a9f83a5f936eaa4.tar.gz
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>
Diffstat (limited to 'tests/weston-test.c')
-rw-r--r--tests/weston-test.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/weston-test.c b/tests/weston-test.c
index 844059dc..35ccaa40 100644
--- a/tests/weston-test.c
+++ b/tests/weston-test.c
@@ -54,6 +54,12 @@ test_client_sigchld(struct weston_process *process, int status)
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);