summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests
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 /tests/auto/testlib/selftests
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 'tests/auto/testlib/selftests')
-rw-r--r--tests/auto/testlib/selftests/expected_warnings.lightxml6
-rw-r--r--tests/auto/testlib/selftests/expected_warnings.txt2
-rw-r--r--tests/auto/testlib/selftests/expected_warnings.xml6
-rw-r--r--tests/auto/testlib/selftests/expected_warnings.xunitxml6
-rw-r--r--tests/auto/testlib/selftests/silent/tst_silent.cpp3
-rw-r--r--tests/auto/testlib/selftests/warnings/tst_warnings.cpp9
6 files changed, 29 insertions, 3 deletions
diff --git a/tests/auto/testlib/selftests/expected_warnings.lightxml b/tests/auto/testlib/selftests/expected_warnings.lightxml
index 31b3d842aa..afbbf5b5e2 100644
--- a/tests/auto/testlib/selftests/expected_warnings.lightxml
+++ b/tests/auto/testlib/selftests/expected_warnings.lightxml
@@ -20,6 +20,12 @@
<Message type="qdebug" file="" line="0">
<Description><![CDATA[Debug]]></Description>
</Message>
+<Message type="qinfo" file="" line="0">
+ <Description><![CDATA[Info]]></Description>
+</Message>
+<Message type="qinfo" file="" line="0">
+ <Description><![CDATA[Info]]></Description>
+</Message>
<Message type="qdebug" file="" line="0">
<Description><![CDATA[Baba]]></Description>
</Message>
diff --git a/tests/auto/testlib/selftests/expected_warnings.txt b/tests/auto/testlib/selftests/expected_warnings.txt
index bb77257b79..9f7393e90f 100644
--- a/tests/auto/testlib/selftests/expected_warnings.txt
+++ b/tests/auto/testlib/selftests/expected_warnings.txt
@@ -5,6 +5,8 @@ QWARN : tst_Warnings::testWarnings() Warning
QWARN : tst_Warnings::testWarnings() Warning
QDEBUG : tst_Warnings::testWarnings() Debug
QDEBUG : tst_Warnings::testWarnings() Debug
+QINFO : tst_Warnings::testWarnings() Info
+QINFO : tst_Warnings::testWarnings() Info
QDEBUG : tst_Warnings::testWarnings() Baba
QDEBUG : tst_Warnings::testWarnings() Baba
QDEBUG : tst_Warnings::testWarnings() Bubublabla
diff --git a/tests/auto/testlib/selftests/expected_warnings.xml b/tests/auto/testlib/selftests/expected_warnings.xml
index a3821f84df..7023e35e0c 100644
--- a/tests/auto/testlib/selftests/expected_warnings.xml
+++ b/tests/auto/testlib/selftests/expected_warnings.xml
@@ -22,6 +22,12 @@
<Message type="qdebug" file="" line="0">
<Description><![CDATA[Debug]]></Description>
</Message>
+<Message type="qinfo" file="" line="0">
+ <Description><![CDATA[Info]]></Description>
+</Message>
+<Message type="qinfo" file="" line="0">
+ <Description><![CDATA[Info]]></Description>
+</Message>
<Message type="qdebug" file="" line="0">
<Description><![CDATA[Baba]]></Description>
</Message>
diff --git a/tests/auto/testlib/selftests/expected_warnings.xunitxml b/tests/auto/testlib/selftests/expected_warnings.xunitxml
index 7ea66522c6..5cca215f12 100644
--- a/tests/auto/testlib/selftests/expected_warnings.xunitxml
+++ b/tests/auto/testlib/selftests/expected_warnings.xunitxml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<testsuite errors="15" failures="4" tests="6" name="tst_Warnings">
+<testsuite errors="17" failures="4" tests="6" name="tst_Warnings">
<properties>
<property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
<property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
@@ -11,6 +11,8 @@
<!-- message="Warning" type="qwarn" -->
<!-- message="Debug" type="qdebug" -->
<!-- message="Debug" type="qdebug" -->
+ <!-- message="Info" type="qinfo" -->
+ <!-- message="Info" type="qinfo" -->
<!-- message="Baba" type="qdebug" -->
<!-- message="Baba" type="qdebug" -->
<!-- message="Bubublabla" type="qdebug" -->
@@ -39,6 +41,8 @@
<![CDATA[Warning]]>
<![CDATA[Debug]]>
<![CDATA[Debug]]>
+<![CDATA[Info]]>
+<![CDATA[Info]]>
<![CDATA[Baba]]>
<![CDATA[Baba]]>
<![CDATA[Bubublabla]]>
diff --git a/tests/auto/testlib/selftests/silent/tst_silent.cpp b/tests/auto/testlib/selftests/silent/tst_silent.cpp
index 545f7d3420..335411e466 100644
--- a/tests/auto/testlib/selftests/silent/tst_silent.cpp
+++ b/tests/auto/testlib/selftests/silent/tst_silent.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 test suite of the Qt Toolkit.
@@ -83,6 +83,7 @@ void tst_Silent::messages()
QWARN("This is an internal testlib warning that should not appear in silent test output");
qDebug("This is a debug message that should not appear in silent test output");
qCritical("This is a critical message that should not appear in silent test output");
+ qInfo("This is an info message that should not appear in silent test output");
QTestLog::info("This is an internal testlib info message that should not appear in silent test output", __FILE__, __LINE__);
qFatal("This is a fatal error message that should still appear in silent test output");
}
diff --git a/tests/auto/testlib/selftests/warnings/tst_warnings.cpp b/tests/auto/testlib/selftests/warnings/tst_warnings.cpp
index b000f37687..9266b83934 100644
--- a/tests/auto/testlib/selftests/warnings/tst_warnings.cpp
+++ b/tests/auto/testlib/selftests/warnings/tst_warnings.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 test suite of the Qt Toolkit.
@@ -63,6 +63,13 @@ void tst_Warnings::testWarnings()
qDebug("Debug");
+ qInfo("Info");
+
+ QTest::ignoreMessage(QtInfoMsg, "Info");
+ qInfo("Info");
+
+ qInfo("Info");
+
QTest::ignoreMessage(QtDebugMsg, "Bubu");
qDebug("Baba");
qDebug("Bubu");