summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/global/qlogging
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@digia.com>2013-09-02 21:00:14 +0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-03 08:42:24 +0200
commitcd582f841076010dac334427830763838c0996b8 (patch)
tree42cf3aa63d8f9c4ce15c960788e4b973cb436048 /tests/auto/corelib/global/qlogging
parent5bd6a4b71a5eeb88ccc2f0fd1515deeeb92e1b53 (diff)
Add QT_NO_PROCESS guards in tests where they are missing
A handful of tests lack QT_NO_PROCESS guards, making them non-compilable on Qt builds with no QProcess support. This commit does not change QProcess-specific tests, which should be left out of the build using the .pro file mechanism. Change-Id: Iac8562428abc1f59ccbb23bf5c3a919785e41f12 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests/auto/corelib/global/qlogging')
-rw-r--r--tests/auto/corelib/global/qlogging/tst_qlogging.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
index 04ce504189..94387704f6 100644
--- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
+++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
@@ -101,6 +101,7 @@ void tst_qmessagehandler::initTestCase()
QVERIFY2(!m_appDir.isEmpty(), qPrintable(
QString::fromLatin1("Couldn't find helper app dir starting from %1.").arg(QDir::currentPath())));
+#ifndef QT_NO_PROCESS
m_baseEnvironment = QProcess::systemEnvironment();
for (int i = 0; i < m_baseEnvironment.count(); ++i) {
if (m_baseEnvironment.at(i).startsWith("QT_MESSAGE_PATTERN=")) {
@@ -108,6 +109,7 @@ void tst_qmessagehandler::initTestCase()
break;
}
}
+#endif // !QT_NO_PROCESS
}
void tst_qmessagehandler::cleanup()
@@ -641,6 +643,9 @@ void tst_qmessagehandler::cleanupFuncinfo()
void tst_qmessagehandler::qMessagePattern()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("This test requires QProcess support");
+#else
QProcess process;
const QString appExe = m_appDir + "/app";
@@ -710,10 +715,14 @@ void tst_qmessagehandler::qMessagePattern()
output.replace("\r\n", "\n");
#endif
QCOMPARE(QString::fromLatin1(output), QString::fromLatin1(expected));
+#endif // !QT_NO_PROCESS
}
void tst_qmessagehandler::qMessagePatternIf()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("This test requires QProcess support");
+#else
QProcess process;
const QString appExe = m_appDir + "/app";
@@ -773,6 +782,7 @@ void tst_qmessagehandler::qMessagePatternIf()
QVERIFY(output.contains("QT_MESSAGE_PATTERN: %{if-*} cannot be nested"));
QVERIFY(output.contains("A DEBUG qDebug"));
QVERIFY(output.contains("A qWarning"));
+#endif // !QT_NO_PROCESS
}
QTEST_MAIN(tst_qmessagehandler)