From 5463402e39abf0cf608843751275dd7054645062 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 14 Nov 2017 02:57:57 +0100 Subject: [PATCH] Try to show when do X errors happen while running tests Install an X11 error handler to try to gather more information about the GUI tests failures on buildbot. --- tests/test.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/test.cpp b/tests/test.cpp index 5c01d4875a..4b5f492fa4 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -409,6 +409,20 @@ void DeleteTestWindow(wxWindow* win) #ifdef __WXGTK__ +#ifdef GDK_WINDOWING_X11 + +#include "X11/Xlib.h" + +extern "C" +int wxTestX11ErrorHandler(Display*, XErrorEvent*) +{ + fprintf(stderr, "\n*** X11 error while running %s(): ", + wxGetCurrentTestName().c_str()); + return 0; +} + +#endif // GDK_WINDOWING_X11 + extern "C" void wxTestGLogHandler(const gchar* domain, @@ -472,6 +486,10 @@ bool TestApp::OnInit() g_log_set_default_handler(wxTestGLogHandler, NULL); #endif // __WXGTK__ +#ifdef GDK_WINDOWING_X11 + XSetErrorHandler(wxTestX11ErrorHandler); +#endif // GDK_WINDOWING_X11 + #endif // wxUSE_GUI return true;