https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/256

Index: tests/test-runner.c
--- tests/test-runner.c.orig
+++ tests/test-runner.c
@@ -308,6 +308,13 @@ is_debugger_attached(void)
 
 	return rc;
 }
+#else
+static int
+is_debugger_attached(void)
+{
+	/* 0=debugger can't be determined */
+	return 0;
+}
 #endif
 
 int main(int argc, char *argv[])
@@ -315,7 +322,7 @@ int main(int argc, char *argv[])
 	const struct test *t;
 	pid_t pid;
 	int total, pass;
-	siginfo_t info;
+	int info;
 
 	if (isatty(fileno(stderr)))
 		is_atty = 1;
@@ -358,37 +365,32 @@ int main(int argc, char *argv[])
 		if (pid == 0)
 			run_test(t); /* never returns */
 
-		if (waitid(P_PID, pid, &info, WEXITED)) {
+		if (waitpid(pid, &info, 0) == -1) {
 			stderr_set_color(RED);
-			fprintf(stderr, "waitid failed: %s\n",
+			fprintf(stderr, "waitpid failed: %s\n",
 				strerror(errno));
 			stderr_reset_color();
 
 			abort();
 		}
 
-		switch (info.si_code) {
-		case CLD_EXITED:
-			if (info.si_status == EXIT_SUCCESS)
+		if (WIFEXITED(info)) {
+			if (WEXITSTATUS(info) == EXIT_SUCCESS)
 				success = !t->must_fail;
 			else
 				success = t->must_fail;
 
 			stderr_set_color(success ? GREEN : RED);
 			fprintf(stderr, "test \"%s\":\texit status %d",
-				t->name, info.si_status);
+				t->name, WEXITSTATUS(info));
 
-			break;
-		case CLD_KILLED:
-		case CLD_DUMPED:
+		} else if (WIFSIGNALED(info)) {
 			if (t->must_fail)
 				success = 1;
 
 			stderr_set_color(success ? GREEN : RED);
 			fprintf(stderr, "test \"%s\":\tsignal %d",
-				t->name, info.si_status);
-
-			break;
+				t->name, WTERMSIG(info));
 		}
 
 		if (success) {
