From 18da1dac20c7d27342e987586a16d125e39197c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 17 Jan 2019 16:03:03 +0100 Subject: testlib: Prevent Apple test logger from stomping on other loggers We were potentially adding the Apple test logger multiple times, and we didn't consider whether the existing loggers were logging to file or not when circumventing them. We now don't use the Apple logger if it would touch stderr and some other logger is using stdout. In the case of no explicit logger being specified on the command line, we allow the Apple logger to take priority over the default plain test logger. Change-Id: I31bbec4f4b3ab84ba9a2be35e8e5db08fee071a7 Reviewed-by: Edward Welbourne --- src/testlib/qtestlog_p.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/testlib/qtestlog_p.h') diff --git a/src/testlib/qtestlog_p.h b/src/testlib/qtestlog_p.h index 0bdd6290e1..e63e89a78e 100644 --- a/src/testlib/qtestlog_p.h +++ b/src/testlib/qtestlog_p.h @@ -53,6 +53,10 @@ #include +#if defined(Q_OS_DARWIN) +#include +#endif + QT_BEGIN_NAMESPACE class QBenchmarkResult; @@ -63,9 +67,12 @@ class Q_TESTLIB_EXPORT QTestLog { public: enum LogMode { - Plain = 0, XML, LightXML, XunitXML, CSV, TeamCity, TAP, + Plain = 0, XML, LightXML, XunitXML, CSV, TeamCity, TAP +#if defined(QT_USE_APPLE_UNIFIED_LOGGING) + , Apple +#endif #if defined(HAVE_XCTEST) - XCTest + , XCTest #endif }; -- cgit v1.2.3