summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/global/qlogging/tst_qlogging.cpp')
-rw-r--r--tests/auto/corelib/global/qlogging/tst_qlogging.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
index 68b1fef71d..140b349c64 100644
--- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
+++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
@@ -765,6 +765,12 @@ void tst_qmessagehandler::qMessagePattern_data()
<< "A DEBUG qDebug "
<< "A qWarning ");
+ QTest::newRow("pid") << "%{pid}: %{message}"
+ << true << QList<QByteArray>(); // can't match anything, just test validity
+ QTest::newRow("threadid") << "ThreadId:%{threadid}: %{message}"
+ << true << (QList<QByteArray>()
+ << "ThreadId:0x");
+
// This test won't work when midnight is too close... wait a bit
while (QTime::currentTime() > QTime(23, 59, 30))
QTest::qWait(10000);
@@ -820,6 +826,7 @@ void tst_qmessagehandler::qMessagePattern()
process.start(appExe);
QVERIFY2(process.waitForStarted(), qPrintable(
QString::fromLatin1("Could not start %1: %2").arg(appExe, process.errorString())));
+ QByteArray pid = QByteArray::number(process.processId());
process.waitForFinished();
QByteArray output = process.readAllStandardError();
@@ -834,6 +841,8 @@ void tst_qmessagehandler::qMessagePattern()
QVERIFY(output.contains(e));
}
}
+ if (pattern.startsWith("%{pid}"))
+ QVERIFY2(output.startsWith('"' + pid), "PID: " + pid + "\noutput:\n" + output);
#endif
}