From 2228caa8d4f5735dcbae0bc4a4642f6885a9e1d4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 14 Oct 2019 23:40:08 +0200 Subject: [PATCH] Don't disable logging in the tests if WXTRACE is set Disabling logging makes WXTRACE useless, so avoid doing it in this case to facilitate debugging the code exercised by the tests. --- tests/test.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test.cpp b/tests/test.cpp index f5135f87fb..1d42529be5 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -577,11 +577,11 @@ bool TestApp::ProcessEvent(wxEvent& event) int TestApp::RunTests() { #if wxUSE_LOG - // Switch off logging unless --verbose - bool verbose = wxLog::GetVerbose(); - wxLog::EnableLogging(verbose); -#else - bool verbose = false; + // Switch off logging to avoid interfering with the tests output unless + // WXTRACE is set, as otherwise setting it would have no effect while + // running the tests. + if ( !wxGetEnv("WXTRACE", NULL) ) + wxLog::EnableLogging(false); #endif // Cast is needed under MSW where Catch also provides an overload taking