File debugtestfail.patch of Package wayland
--- wayland-1.23.1/tests/test-runner.c.orig 2024-08-24 23:43:55.000000000 +0800
+++ wayland-1.23.1/tests/test-runner.c 2024-12-30 11:22:29.624920183 +0800
@@ -59,6 +59,9 @@ int fd_leak_check_enabled;
* suppressed - handy when debugging the test. Can be set by
* WAYLAND_TEST_NO_TIMEOUTS environment variable. */
static int timeouts_enabled = 1;
+static int timeouts_suppressed_by_env = 0;
+static int timeouts_suppressed_by_debugger = 0;
+static int write_pipefd_reached = 0;
/* set to one if the output goes to the terminal */
static int is_atty = 0;
@@ -95,6 +98,8 @@ usage(const char *name, int status)
exit(status);
}
+static int is_debugger_attached(void);
+
void
test_set_timeout(unsigned int to)
{
@@ -102,6 +107,9 @@ test_set_timeout(unsigned int to)
if (!timeouts_enabled) {
fprintf(stderr, "Timeouts suppressed.\n");
+ fprintf(stderr, "Timeouts suppressed by debugger: %d, timeouts suppressed by env: %d.\n", timeouts_suppressed_by_debugger, timeouts_suppressed_by_env);
+ fprintf(stderr, "is_debugger_attached(): %d\n", is_debugger_attached());
+ fprintf(stderr, "write_pipefd_reached: %d\n", write_pipefd_reached);
return;
}
@@ -299,6 +307,7 @@ is_debugger_attached(void)
} else {
/* Signal to client that parent is ready by passing '+' */
write(pipefd[1], "+", 1);
+ write_pipefd_reached = 1;
}
close(pipefd[1]);
@@ -330,9 +339,14 @@ int main(int argc, char *argv[])
if (is_debugger_attached()) {
fd_leak_check_enabled = 0;
timeouts_enabled = 0;
+ timeouts_suppressed_by_debugger = 1;
+ fprintf(stderr, "Timeouts suppressed by debugger!");
+ fprintf(stderr, "is_debugger_attached(): %d", is_debugger_attached());
} else {
fd_leak_check_enabled = !getenv("WAYLAND_TEST_NO_LEAK_CHECK");
timeouts_enabled = !getenv("WAYLAND_TEST_NO_TIMEOUTS");
+ timeouts_suppressed_by_env = !timeouts_enabled;
+ fprintf(stderr, "WAYLAND_TEST_NO_TIMEOUTS is %d.\n", timeouts_suppressed_by_env);
}
if (argc == 2 && strcmp(argv[1], "--help") == 0)