From 2c8203dcb0d235c4c5821b94ac2853d887dd2a44 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 31 Oct 2019 17:20:17 +0200 Subject: [PATCH] tests: move exit() from run_test() I will be able to re-use this function if it does not call exit() itself. Signed-off-by: Pekka Paalanen --- tests/weston-test-runner.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/weston-test-runner.c b/tests/weston-test-runner.c index 1fa1276e..ee17ba4d 100644 --- a/tests/weston-test-runner.c +++ b/tests/weston-test-runner.c @@ -85,7 +85,6 @@ run_test(const struct weston_test_entry *t, void *data, int iteration) } t->run(data); - exit(EXIT_SUCCESS); } static void @@ -111,8 +110,10 @@ exec_and_report_test(const struct weston_test_entry *t, pid_t pid = fork(); assert(pid >= 0); - if (pid == 0) - run_test(t, test_data, iteration); /* never returns */ + if (pid == 0) { + run_test(t, test_data, iteration); + exit(EXIT_SUCCESS); + } if (waitid(P_ALL, 0, &info, WEXITED)) { fprintf(stderr, "waitid failed: %s\n", strerror(errno));