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

Daniel Vetter daniel.vetter at ffwll.ch
Thu Feb 7 16:50:55 UTC 2019


Another corner case to check.

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 d495c7815e06..5ff2956dd0ab 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) {
@@ -82,6 +91,11 @@ int main(int argc, char **argv)
 {
 	int ret;
 
+	/* check that igt_assert is forwarded */
 	ret = do_fork(igt_fork_vs_assert);
 	internal_assert(ret == IGT_EXIT_FAILURE);
+
+	/* check that igt_skip within a fork blows up */
+	ret = do_fork(igt_fork_vs_skip);
+	internal_assert(ret == SIGABRT + 128);
 }
-- 
2.20.1



More information about the igt-dev mailing list