summaryrefslogtreecommitdiff
path: root/lib/tests
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2019-02-13 11:35:45 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2019-02-15 10:36:40 +0100
commitecdf823b965f93269ccfc4ed89c4a06e13d3ff2c (patch)
tree1779085a0457792f0ec8b498e742d1bd77ecb35c /lib/tests
parent06dbdbaeae7fe93cd71b4f70626f268b54a905d0 (diff)
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 <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'lib/tests')
-rw-r--r--lib/tests/igt_fork.c14
1 files changed, 14 insertions, 0 deletions
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);
}