mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-09-06 18:05:39 +00:00
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>
This commit is contained in:
parent
61a6b03d6f
commit
2c8203dcb0
|
@ -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…
Reference in a new issue