diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-03-08 13:19:18 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-03-09 16:31:53 +0000 |
commit | 73b2dd49c2396ab6a2b8ee31385119ec41257920 (patch) | |
tree | 030ac6d829c55766b38e749f391b6e1c31adc893 /src/testlib/qabstracttestlogger_p.h | |
parent | bc008afb0e3724a89890e9bd68451b1903bc8e17 (diff) |
testlib: Feed test log messages to Apple Unified Logging
QtTestLib uses its own message handler for plain text logging, so it doesn't
go though the logic in qDefaultMessageHandler that dispatches logging to
alternate logging sinks.
Building on the approach of Android and Windows, we log to AUL from the
plain text logger. A future improvement in this area would be to make
QtTestLib make more use of the infrastructure in qlogging.cpp, but this
is a bigger task and requires a better overview of the requirements.
The AUL code has been isolated into a wrapper, to allow logging both
to AUl and to e.g. the QPlainTextLogger. This is needed so that we
short circuit the plain text logger in case AUL already has handled
printing to stderr.
Change-Id: Iee0c3902190bd081b7ffbaf77c41b3118ce7f6da
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/testlib/qabstracttestlogger_p.h')
-rw-r--r-- | src/testlib/qabstracttestlogger_p.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/testlib/qabstracttestlogger_p.h b/src/testlib/qabstracttestlogger_p.h index c4083b43f4..a8796d10f0 100644 --- a/src/testlib/qabstracttestlogger_p.h +++ b/src/testlib/qabstracttestlogger_p.h @@ -175,6 +175,11 @@ namespace QTest int qt_asprintf(QTestCharBuffer *buf, const char *format, ...); } +namespace QTestPrivate +{ + enum IdentifierPart { TestObject = 0x1, TestFunction = 0x2, TestDataTag = 0x4, AllParts = 0xFFFF }; + void generateTestIdentifier(QTestCharBuffer *identifier, int parts = AllParts); +} QT_END_NAMESPACE |