summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/global
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-11-23 12:25:17 +0100
committerUlf Hermann <ulf.hermann@qt.io>2017-02-27 15:44:46 +0000
commit44af54419eaceb27bb729717d6363917fd6bb819 (patch)
treeb111875dd8cb8ff653cb0e27cfa766933ca6d589 /tests/auto/corelib/global
parent85b30fda7ceccecfd3938703979b3431bdedc9a2 (diff)
Properly use the "process" feature
Replace all QT_NO_PROCESS with QT_CONFIG(process), define it in qconfig-bootstrapped.h, add QT_REQUIRE_CONFIG(process) to the qprocess headers, exclude the sources from compilation when switched off, guard header inclusions in places where compilation without QProcess seems supported, drop some unused includes, and fix some tests that were apparently designed to work with QT_NO_PROCESS but failed to. Change-Id: Ieceea2504dea6fdf43b81c7c6b65c547b01b9714 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'tests/auto/corelib/global')
-rw-r--r--tests/auto/corelib/global/qlogging/tst_qlogging.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
index c2d7338042..bb8bb6cc21 100644
--- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
+++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
@@ -29,7 +29,9 @@
#include <qdebug.h>
#include <qglobal.h>
-#include <QtCore/QProcess>
+#if QT_CONFIG(process)
+# include <QtCore/QProcess>
+#endif
#include <QtTest/QTest>
class tst_qmessagehandler : public QObject
@@ -102,7 +104,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
+#if QT_CONFIG(process)
m_baseEnvironment = QProcess::systemEnvironment();
for (int i = 0; i < m_baseEnvironment.count(); ++i) {
if (m_baseEnvironment.at(i).startsWith("QT_MESSAGE_PATTERN=")) {
@@ -110,7 +112,7 @@ void tst_qmessagehandler::initTestCase()
break;
}
}
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
void tst_qmessagehandler::cleanup()
@@ -813,7 +815,7 @@ void tst_qmessagehandler::qMessagePattern_data()
void tst_qmessagehandler::qMessagePattern()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("This test requires QProcess support");
#else
QFETCH(QString, pattern);
@@ -855,7 +857,7 @@ void tst_qmessagehandler::qMessagePattern()
void tst_qmessagehandler::setMessagePattern()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("This test requires QProcess support");
#else
@@ -892,7 +894,7 @@ void tst_qmessagehandler::setMessagePattern()
output.replace("\r\n", "\n");
#endif
QCOMPARE(QString::fromLatin1(output), QString::fromLatin1(expected));
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
Q_DECLARE_METATYPE(QtMsgType)