summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2014-12-04 16:57:32 +0100
committerKai Koehne <kai.koehne@theqtcompany.com>2015-01-09 13:14:05 +0100
commitef6279fd516befc09d4a6b3664a727a013b82c19 (patch)
tree4365a6dfb7c8d8e3094f35eb1ffe8fb8a23088cf /src/testlib
parent4c980aedc17c1da8f7160989fbb845ea72b36f44 (diff)
Add QtInfoMsg
Add an 'info' message type that can be used for messages that are neither warnings (QtWarningMsg), nor for debugging only (QtDebugMsg). This is useful mainly for applications that do not have to adhere to the 'do not print anything by default' paradigm that we have for the Qt libraries itself. [ChangeLog][QtCore][Logging] QtInfoMsg got added as a new QtMsgType. Use the new qInfo(), qCInfo() macros to log to it. Change-Id: I810995d63de46c41a9a99a34d37c0d417fa87a05 Reviewed-by: Jason McDonald <macadder1@gmail.com>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qabstracttestlogger_p.h5
-rw-r--r--src/testlib/qplaintestlogger.cpp4
-rw-r--r--src/testlib/qtestcase.cpp6
-rw-r--r--src/testlib/qtestlog.cpp5
-rw-r--r--src/testlib/qxmltestlogger.cpp4
-rw-r--r--src/testlib/qxunittestlogger.cpp5
6 files changed, 20 insertions, 9 deletions
diff --git a/src/testlib/qabstracttestlogger_p.h b/src/testlib/qabstracttestlogger_p.h
index 894f4fc9d8..db240c6934 100644
--- a/src/testlib/qabstracttestlogger_p.h
+++ b/src/testlib/qabstracttestlogger_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtTest module of the Qt Toolkit.
@@ -72,7 +72,8 @@ public:
QSystem,
QFatal,
Skip,
- Info
+ Info,
+ QInfo
};
QAbstractTestLogger(const char *filename);
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp
index e58daa528d..6f63aa19c3 100644
--- a/src/testlib/qplaintestlogger.cpp
+++ b/src/testlib/qplaintestlogger.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtTest module of the Qt Toolkit.
@@ -105,6 +105,8 @@ namespace QTest {
return "QWARN ";
case QAbstractTestLogger::QDebug:
return "QDEBUG ";
+ case QAbstractTestLogger::QInfo:
+ return "QINFO ";
case QAbstractTestLogger::QSystem:
return "QSYSTEM";
case QAbstractTestLogger::QFatal:
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index efc3e41149..a2e4b66ebf 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtTest module of the Qt Toolkit.
@@ -2597,7 +2597,7 @@ void QTest::qWarn(const char *message, const char *file, int line)
}
/*!
- Ignores messages created by qDebug() or qWarning(). If the \a message
+ Ignores messages created by qDebug(), qInfo() or qWarning(). If the \a message
with the corresponding \a type is outputted, it will be removed from the
test log. If the test finished and the \a message was not outputted,
a test failure is appended to the test log.
@@ -2621,7 +2621,7 @@ void QTest::ignoreMessage(QtMsgType type, const char *message)
/*!
\overload
- Ignores messages created by qDebug() or qWarning(). If the message
+ Ignores messages created by qDebug(), qInfo() or qWarning(). If the message
matching \a messagePattern
with the corresponding \a type is outputted, it will be removed from the
test log. If the test finished and the message was not outputted,
diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp
index e48fdc1ad0..9bdc7c186c 100644
--- a/src/testlib/qtestlog.cpp
+++ b/src/testlib/qtestlog.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtTest module of the Qt Toolkit.
@@ -295,6 +295,9 @@ namespace QTest {
case QtDebugMsg:
QTest::TestLoggers::addMessage(QAbstractTestLogger::QDebug, msg);
break;
+ case QtInfoMsg:
+ QTest::TestLoggers::addMessage(QAbstractTestLogger::QInfo, msg);
+ break;
case QtCriticalMsg:
QTest::TestLoggers::addMessage(QAbstractTestLogger::QSystem, msg);
break;
diff --git a/src/testlib/qxmltestlogger.cpp b/src/testlib/qxmltestlogger.cpp
index 4e26b25f1e..3aa222bace 100644
--- a/src/testlib/qxmltestlogger.cpp
+++ b/src/testlib/qxmltestlogger.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtTest module of the Qt Toolkit.
@@ -55,6 +55,8 @@ namespace QTest {
return "system";
case QAbstractTestLogger::QDebug:
return "qdebug";
+ case QAbstractTestLogger::QInfo:
+ return "qinfo";
case QAbstractTestLogger::QWarning:
return "qwarn";
case QAbstractTestLogger::QFatal:
diff --git a/src/testlib/qxunittestlogger.cpp b/src/testlib/qxunittestlogger.cpp
index e98ddb5e4f..0005eebe0e 100644
--- a/src/testlib/qxunittestlogger.cpp
+++ b/src/testlib/qxunittestlogger.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtTest module of the Qt Toolkit.
@@ -298,6 +298,9 @@ void QXunitTestLogger::addMessage(MessageTypes type, const QString &message, con
case QAbstractTestLogger::QDebug:
typeBuf = "qdebug";
break;
+ case QAbstractTestLogger::QInfo:
+ typeBuf = "qinfo";
+ break;
case QAbstractTestLogger::QWarning:
typeBuf = "qwarn";
break;