[igt-dev] [PATCH i-g-t 3/9] lib/tests: make sure igt_skip in igt_fork is forbidden

Daniel Vetter daniel.vetter at ffwll.ch
Wed Feb 13 10:35:45 UTC 2019


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.

Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
 lib/tests/igt_fork.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lib/tests/igt_fork.c b/lib/tests/igt_fork.c
index 8d3c1bd02288..6769e84a6989 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);
 }
-- 
2.20.1



More information about the igt-dev mailing list