From ecdf823b965f93269ccfc4ed89c4a06e13d3ff2c Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Wed, 13 Feb 2019 11:35:45 +0100 Subject: 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 Signed-off-by: Daniel Vetter --- lib/tests/igt_fork.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/tests') diff --git a/lib/tests/igt_fork.c b/lib/tests/igt_fork.c index 8d3c1bd0..6769e84a 100644 --- a/lib/tests/igt_fork.c +++ b/lib/tests/igt_fork.c @@ -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); } -- cgit v1.2.3