summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestlog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib/qtestlog.cpp')
-rw-r--r--src/testlib/qtestlog.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp
index 6260b9e3fd..1268730cc6 100644
--- a/src/testlib/qtestlog.cpp
+++ b/src/testlib/qtestlog.cpp
@@ -47,10 +47,15 @@
#include <QtTest/private/qxunittestlogger_p.h>
#include <QtTest/private/qxmltestlogger_p.h>
#include <QtTest/private/qteamcitylogger_p.h>
+#include <QtTest/private/qtaptestlogger_p.h>
#if defined(HAVE_XCTEST)
#include <QtTest/private/qxctestlogger_p.h>
#endif
+#if defined(Q_OS_DARWIN)
+#include <QtTest/private/qappletestlogger_p.h>
+#endif
+
#include <QtCore/qatomic.h>
#include <QtCore/qbytearray.h>
#include <QtCore/QElapsedTimer>
@@ -211,6 +216,11 @@ namespace QTest {
FOREACH_LOGGER(logger->leaveTestFunction());
}
+ static void enterTestData(QTestData *data)
+ {
+ FOREACH_LOGGER(logger->enterTestData(data));
+ }
+
static void addIncident(QAbstractTestLogger::IncidentTypes type, const char *description,
const char *file = 0, int line = 0)
{
@@ -339,6 +349,12 @@ void QTestLog::enterTestFunction(const char* function)
QTest::TestLoggers::enterTestFunction(function);
}
+void QTestLog::enterTestData(QTestData *data)
+{
+ QTEST_ASSERT(data);
+ QTest::TestLoggers::enterTestData(data);
+}
+
int QTestLog::unhandledIgnoreMessages()
{
int i = 0;
@@ -498,12 +514,24 @@ void QTestLog::addLogger(LogMode mode, const char *filename)
case QTestLog::TeamCity:
logger = new QTeamCityLogger(filename);
break;
+ case QTestLog::TAP:
+ logger = new QTapTestLogger(filename);
+ break;
#if defined(HAVE_XCTEST)
case QTestLog::XCTest:
logger = new QXcodeTestLogger;
break;
#endif
}
+
+#if defined(QT_USE_APPLE_UNIFIED_LOGGING)
+ // Logger that also feeds messages to AUL. It needs to wrap the existing
+ // logger, as it needs to be able to short circuit the existing logger
+ // in case AUL prints to stderr.
+ if (QAppleTestLogger::debugLoggingEnabled())
+ logger = new QAppleTestLogger(logger);
+#endif
+
QTEST_ASSERT(logger);
QTest::TestLoggers::addLogger(logger);
}
@@ -591,6 +619,11 @@ int QTestLog::blacklistCount()
return QTest::blacklists;
}
+int QTestLog::totalCount()
+{
+ return passCount() + failCount() + skipCount() + blacklistCount();
+}
+
void QTestLog::resetCounters()
{
QTest::passes = 0;