[i-g-t,2/9] lib/tests: make sure igt_skip in igt_fork is forbidden

Submitted by Daniel Vetter on Feb. 11, 2019, 6:02 p.m.

Details

Message ID 20190211180208.29406-2-daniel.vetter@ffwll.ch
State New
Series "Series without cover letter"
Headers show

Commit Message

Daniel Vetter Feb. 11, 2019, 6:02 p.m.
Another corner case to check.

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

Patch hide | download patch | download mbox

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);
 }