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 <pekka.paalanen@collabora.com>
dev
Pekka Paalanen 5 years ago committed by Daniel Stone
parent 61a6b03d6f
commit 2c8203dcb0
  1. 7
      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));

Loading…
Cancel
Save