From 9df5541c537778289028aaa8b006939eaeec2ed4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 13 Jan 2018 18:08:07 +0100 Subject: [PATCH] Don't show dialogs from OnExceptionInMainLoop() in the tests Similarly to the previous commit, ensure that the tests can run unattended under MSW even if an unhandled exception is thrown during their execution. --- tests/test.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test.cpp b/tests/test.cpp index 09ab1e8f4b..7dbb44fb53 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -219,6 +219,16 @@ public: } #endif // __WIN32__ + // Also override this method to avoid showing any dialogs from here -- and + // show some details about the exception along the way. + virtual bool OnExceptionInMainLoop() + { + wxFprintf(stderr, "Unhandled exception in the main loop: %s\n", + Catch::translateActiveException()); + + throw; + } + // used by events propagation test virtual int FilterEvent(wxEvent& event); virtual bool ProcessEvent(wxEvent& event);