Commit ecdf823b authored by Daniel Vetter's avatar Daniel Vetter

lib/tests: make sure igt_skip in igt_fork is forbidden

Another corner case to check.

v2: Rebase. Note that we still have the SIG + 128 exit code, that's
how igt_waitchildren forwards child death to the parent's exit code.
Reviewed-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter's avatarDaniel Vetter <daniel.vetter@intel.com>
parent 06dbdbae
......@@ -43,6 +43,15 @@
char test[] = "test";
char *argv_run[] = { test };
static void igt_fork_vs_skip(void)
{
igt_fork(i, 1) {
igt_skip("skipping");
}
igt_waitchildren();
}
static void igt_fork_vs_assert(void)
{
igt_fork(i, 1) {
......@@ -79,6 +88,11 @@ int main(int argc, char **argv)
{
int ret;
/* check that igt_assert is forwarded */
ret = do_fork(igt_fork_vs_assert);
internal_assert(WEXITSTATUS(ret) == IGT_EXIT_FAILURE);
/* check that igt_skip within a fork blows up */
ret = do_fork(igt_fork_vs_skip);
internal_assert(WEXITSTATUS(ret) == SIGABRT + 128);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment