summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r--tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp6
-rw-r--r--tests/auto/corelib/global/qlogging/tst_qlogging.cpp14
-rw-r--r--tests/auto/corelib/io/io.pro8
-rw-r--r--tests/auto/corelib/io/qdir/tst_qdir.cpp4
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp14
-rw-r--r--tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp28
-rw-r--r--tests/auto/corelib/io/qprocess/testForwarding/main.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp13
-rw-r--r--tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp11
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp9
-rw-r--r--tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp12
-rw-r--r--tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp8
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/tst_qmimedatabase-cache.cpp2
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp12
-rw-r--r--tests/auto/corelib/plugin/quuid/tst_quuid.cpp4
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp6
-rw-r--r--tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp12
-rw-r--r--tests/auto/corelib/tools/qlocale/tst_qlocale.cpp12
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/externaltests.cpp18
19 files changed, 98 insertions, 97 deletions
diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
index bdd862e316..0f2e9b5d68 100644
--- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
@@ -33,7 +33,9 @@
#include <qtextcodec.h>
#include <qfile.h>
#include <time.h>
-#include <qprocess.h>
+#if QT_CONFIG(process)
+# include <qprocess.h>
+#endif
#include <QThreadPool>
class tst_QTextCodec : public QObject
@@ -2085,7 +2087,7 @@ void tst_QTextCodec::codecForUtfText()
#if defined(Q_OS_UNIX)
void tst_QTextCodec::toLocal8Bit()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
QProcess process;
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)
diff --git a/tests/auto/corelib/io/io.pro b/tests/auto/corelib/io/io.pro
index 0542833456..5e20f5de5c 100644
--- a/tests/auto/corelib/io/io.pro
+++ b/tests/auto/corelib/io/io.pro
@@ -56,12 +56,14 @@ SUBDIRS=\
qurlinternal \
qloggingregistry
+!qtConfig(process): SUBDIRS -= \
+ qprocess \
+ qprocess-noapplication \
+ qprocessenvironment
+
win32:!qtConfig(private_tests): SUBDIRS -= \
qfilesystementry
winrt: SUBDIRS -= \
- qprocess \
- qprocess-noapplication \
- qprocessenvironment \
qstorageinfo \
qwinoverlappedionotifier
diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp
index c3774997e9..6232ce4c66 100644
--- a/tests/auto/corelib/io/qdir/tst_qdir.cpp
+++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp
@@ -852,7 +852,7 @@ void tst_QDir::entryList()
void tst_QDir::entryListTimedSort()
{
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
const QString touchBinary = "/bin/touch";
if (!QFile::exists(touchBinary))
QSKIP("/bin/touch not found");
@@ -886,7 +886,7 @@ void tst_QDir::entryListTimedSort()
QCOMPARE(actual.last(), aFileInfo.fileName());
#else
QSKIP("This test requires QProcess support.");
-#endif // QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
void tst_QDir::entryListSimple_data()
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index 34ad2813b0..8595c048b2 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -50,7 +50,9 @@ QT_END_NAMESPACE
#if !defined(QT_NO_NETWORK)
#include <QHostInfo>
#endif
-#include <QProcess>
+#if QT_CONFIG(process)
+# include <QProcess>
+#endif
#ifdef Q_OS_WIN
# include <qt_windows.h>
#else
@@ -884,7 +886,7 @@ void tst_QFile::readAllBuffer()
QFile::remove(fileName);
}
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
class StdinReaderProcessGuard { // Ensure the stdin reader process is stopped on destruction.
Q_DISABLE_COPY(StdinReaderProcessGuard)
@@ -908,11 +910,11 @@ public:
private:
QProcess *m_process;
};
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
void tst_QFile::readAllStdin()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
QByteArray lotsOfData(1024, '@'); // 10 megs
@@ -935,7 +937,7 @@ void tst_QFile::readAllStdin()
void tst_QFile::readLineStdin()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
QByteArray lotsOfData(1024, '@'); // 10 megs
@@ -976,7 +978,7 @@ void tst_QFile::readLineStdin()
void tst_QFile::readLineStdin_lineByLine()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
for (int i = 0; i < 2; ++i) {
diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
index b21701f341..a13ff0358a 100644
--- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
+++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
@@ -72,7 +72,7 @@ void tst_QLockFile::initTestCase()
{
#if defined(Q_OS_ANDROID)
QSKIP("This test requires deploying and running external console applications");
-#elif defined(QT_NO_PROCESS)
+#elif !QT_CONFIG(process)
QSKIP("This test requires QProcess support");
#else
QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
@@ -80,7 +80,7 @@ void tst_QLockFile::initTestCase()
QString testdata_dir = QFileInfo(QFINDTESTDATA("qlockfiletesthelper")).absolutePath();
QVERIFY2(QDir::setCurrent(testdata_dir), qPrintable("Could not chdir to " + testdata_dir));
m_helperApp = "qlockfiletesthelper/qlockfile_test_helper";
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
void tst_QLockFile::lockUnlock()
@@ -114,7 +114,7 @@ void tst_QLockFile::lockUnlock()
void tst_QLockFile::lockOutOtherProcess()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("This test requires QProcess support");
#else
// Lock
@@ -138,7 +138,7 @@ void tst_QLockFile::lockOutOtherProcess()
QCOMPARE(ret, int(QLockFile::NoError));
// Lock doesn't survive process though (on clean exit)
QVERIFY(!QFile::exists(fileName));
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
static QLockFile::LockError tryLockFromThread(const QString &fileName)
@@ -254,7 +254,7 @@ void tst_QLockFile::staleLockFromCrashedProcess_data()
void tst_QLockFile::staleLockFromCrashedProcess()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("This test requires QProcess support");
#else
QFETCH(int, staleLockTime);
@@ -274,12 +274,12 @@ void tst_QLockFile::staleLockFromCrashedProcess()
QVERIFY(secondLock.tryLock());
#endif
QCOMPARE(int(secondLock.error()), int(QLockFile::NoError));
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
void tst_QLockFile::staleLockFromCrashedProcessReusedPid()
{
-#if defined(QT_NO_PROCESS)
+#if !QT_CONFIG(process)
QSKIP("This test requires QProcess support");
#elif defined(Q_OS_WINRT) || defined(QT_PLATFORM_UIKIT)
QSKIP("We cannot retrieve information about other processes on this platform.");
@@ -298,12 +298,12 @@ void tst_QLockFile::staleLockFromCrashedProcessReusedPid()
secondLock.setStaleLockTime(0);
QVERIFY(secondLock.tryLock());
QCOMPARE(int(secondLock.error()), int(QLockFile::NoError));
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
void tst_QLockFile::staleShortLockFromBusyProcess()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("This test requires QProcess support");
#else
const QString fileName = dir.path() + "/staleLockFromBusyProcess";
@@ -331,12 +331,12 @@ void tst_QLockFile::staleShortLockFromBusyProcess()
proc.waitForFinished();
QVERIFY(secondLock.tryLock());
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
void tst_QLockFile::staleLongLockFromBusyProcess()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("This test requires QProcess support");
#else
const QString fileName = dir.path() + "/staleLockFromBusyProcess";
@@ -358,7 +358,7 @@ void tst_QLockFile::staleLongLockFromBusyProcess()
QVERIFY(!secondLock.removeStaleLockFile());
proc.waitForFinished();
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
static QString tryStaleLockFromThread(const QString &fileName)
@@ -388,7 +388,7 @@ static QString tryStaleLockFromThread(const QString &fileName)
void tst_QLockFile::staleLockRace()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("This test requires QProcess support");
#else
// Multiple threads notice a stale lock at the same time
@@ -406,7 +406,7 @@ void tst_QLockFile::staleLockRace()
synchronizer.waitForFinished();
foreach (const QFuture<QString> &future, synchronizer.futures())
QVERIFY2(future.result().isEmpty(), qPrintable(future.result()));
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
void tst_QLockFile::noPermissions()
diff --git a/tests/auto/corelib/io/qprocess/testForwarding/main.cpp b/tests/auto/corelib/io/qprocess/testForwarding/main.cpp
index d76156219e..b7367ff8c6 100644
--- a/tests/auto/corelib/io/qprocess/testForwarding/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testForwarding/main.cpp
@@ -38,7 +38,6 @@ int main(int argc, char **argv)
if (argc < 3)
return 13;
-#ifndef QT_NO_PROCESS
QProcess process;
QProcess::ProcessChannelMode mode = (QProcess::ProcessChannelMode)atoi(argv[1]);
@@ -69,6 +68,5 @@ int main(int argc, char **argv)
if ((mode == QProcess::ForwardedErrorChannel || mode == QProcess::ForwardedChannels)
&& !process.readAllStandardError().isEmpty())
return 6;
-#endif
return 0;
}
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
index 3f3533c9a1..82efbdcb2c 100644
--- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
+++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
@@ -53,7 +53,6 @@ public slots:
void cleanupTestCase();
void init();
-#ifndef QT_NO_PROCESS
private slots:
void getSetCheck();
void constructing();
@@ -159,26 +158,18 @@ protected slots:
private:
qint64 bytesAvailable;
QTemporaryDir m_temporaryDir;
-#endif //QT_NO_PROCESS
};
void tst_QProcess::initTestCase()
{
-#ifdef QT_NO_PROCESS
- QSKIP("This test requires QProcess support");
-#else
QVERIFY2(m_temporaryDir.isValid(), qPrintable(m_temporaryDir.errorString()));
// chdir to our testdata path and execute helper apps relative to that.
QString testdata_dir = QFileInfo(QFINDTESTDATA("testProcessNormal")).absolutePath();
QVERIFY2(QDir::setCurrent(testdata_dir), qPrintable("Could not chdir to " + testdata_dir));
-#endif
}
void tst_QProcess::cleanupTestCase()
{
-#ifdef QT_NO_PROCESS
- QSKIP("This test requires QProcess support");
-#endif
}
void tst_QProcess::init()
@@ -186,8 +177,6 @@ void tst_QProcess::init()
bytesAvailable = 0;
}
-#ifndef QT_NO_PROCESS
-
// Testing get/set functions
void tst_QProcess::getSetCheck()
{
@@ -2406,7 +2395,5 @@ void tst_QProcess::processEventsInAReadyReadSlot()
QVERIFY(process.waitForFinished());
}
-#endif //QT_NO_PROCESS
-
QTEST_MAIN(tst_QProcess)
#include "tst_qprocess.moc"
diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
index 7f29e2a7d7..0e423a56ca 100644
--- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
+++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
@@ -40,8 +40,9 @@
#include <QTemporaryDir>
#include <QTextStream>
#include <QTextCodec>
-#include <QProcess>
-
+#if QT_CONFIG(process)
+# include <QProcess>
+#endif
#include "../../../network-settings.h"
@@ -1493,7 +1494,7 @@ void tst_QTextStream::pos3LargeFile()
// ------------------------------------------------------------------------------
void tst_QTextStream::readStdin()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
QProcess stdinProcess;
@@ -1520,7 +1521,7 @@ void tst_QTextStream::readStdin()
// ------------------------------------------------------------------------------
void tst_QTextStream::readAllFromStdin()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
QProcess stdinProcess;
@@ -1541,7 +1542,7 @@ void tst_QTextStream::readAllFromStdin()
// ------------------------------------------------------------------------------
void tst_QTextStream::readLineFromStdin()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
QProcess stdinProcess;
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index 7b75438b19..50f0061905 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -41,8 +41,9 @@
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
-#include <QProcess>
-
+#if QT_CONFIG(process)
+# include <QProcess>
+#endif
#include "qobject.h"
#ifdef QT_BUILD_INTERNAL
#include <private/qobject_p.h>
@@ -281,7 +282,7 @@ static void playWithObjects()
void tst_QObject::initTestCase()
{
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
const QString testDataDir = QFileInfo(QFINDTESTDATA("signalbug")).absolutePath();
QVERIFY2(QDir::setCurrent(testDataDir), qPrintable("Could not chdir to " + testDataDir));
#endif
@@ -3006,7 +3007,7 @@ void tst_QObject::dynamicProperties()
void tst_QObject::recursiveSignalEmission()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
QProcess proc;
diff --git a/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp b/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp
index 26caff4301..8833321b4f 100644
--- a/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp
+++ b/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp
@@ -28,7 +28,9 @@
#include <QDebug>
#include <QFile>
-#include <QProcess>
+#if QT_CONFIG(process)
+# include <QProcess>
+#endif
#include <QSharedMemory>
#include <QTest>
#include <QThread>
@@ -133,7 +135,7 @@ tst_QSharedMemory::~tst_QSharedMemory()
void tst_QSharedMemory::initTestCase()
{
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
QVERIFY2(!m_helperBinary.isEmpty(), "Could not find helper binary");
#endif
}
@@ -455,7 +457,7 @@ void tst_QSharedMemory::emptyMemory()
#if !defined(Q_OS_WIN)
void tst_QSharedMemory::readOnly()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
rememberKey("readonly_segfault");
@@ -736,7 +738,7 @@ void tst_QSharedMemory::simpleThreadedProducerConsumer()
void tst_QSharedMemory::simpleProcessProducerConsumer_data()
{
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
QTest::addColumn<int>("processes");
int tries = 5;
for (int i = 0; i < tries; ++i) {
@@ -751,7 +753,7 @@ void tst_QSharedMemory::simpleProcessProducerConsumer_data()
*/
void tst_QSharedMemory::simpleProcessProducerConsumer()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
QFETCH(int, processes);
diff --git a/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp b/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp
index 641ea5fc9d..6ff1e14976 100644
--- a/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp
+++ b/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp
@@ -172,7 +172,7 @@ void tst_QSystemSemaphore::release()
void tst_QSystemSemaphore::basicProcesses()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
QSystemSemaphore sem("store", 0, QSystemSemaphore::Create);
@@ -208,7 +208,7 @@ void tst_QSystemSemaphore::processes_data()
void tst_QSystemSemaphore::processes()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
QSystemSemaphore sem("store", 1, QSystemSemaphore::Create);
@@ -237,7 +237,7 @@ void tst_QSystemSemaphore::processes()
#if !defined(Q_OS_WIN) && !defined(QT_POSIX_IPC)
void tst_QSystemSemaphore::undo()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
QSystemSemaphore sem("store", 1, QSystemSemaphore::Create);
@@ -262,7 +262,7 @@ void tst_QSystemSemaphore::undo()
void tst_QSystemSemaphore::initialValue()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
QSystemSemaphore sem("store", 1, QSystemSemaphore::Create);
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/tst_qmimedatabase-cache.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/tst_qmimedatabase-cache.cpp
index 1ca730d0c7..529c8942b3 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/tst_qmimedatabase-cache.cpp
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/tst_qmimedatabase-cache.cpp
@@ -36,7 +36,7 @@
void tst_QMimeDatabase::initTestCaseInternal()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
const QString mimeDirName = m_globalXdgDir + QStringLiteral("/mime");
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
index 2edb94d542..02ba987ccd 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
@@ -858,7 +858,7 @@ void tst_QMimeDatabase::fromThreads()
QVERIFY(tp.waitForDone(60000));
}
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
enum {
UpdateMimeDatabaseTimeout = 120 * 1000 // 2min
@@ -901,7 +901,7 @@ static bool waitAndRunUpdateMimeDatabase(const QString &path)
}
return runUpdateMimeDatabase(path);
}
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
static void checkHasMimeType(const QString &mimeType)
{
@@ -936,7 +936,7 @@ void tst_QMimeDatabase::installNewGlobalMimeType()
QSKIP("This test requires XDG_DATA_DIRS");
#endif
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("This test requires QProcess support");
#else
qmime_secondsBetweenChecks = 0;
@@ -989,12 +989,12 @@ void tst_QMimeDatabase::installNewGlobalMimeType()
QCOMPARE(db.mimeTypeForFile(QLatin1String("foo.ymu"), QMimeDatabase::MatchExtension).name(),
QString::fromLatin1("application/octet-stream"));
QVERIFY(!db.mimeTypeForName(QLatin1String("text/x-suse-ymp")).isValid());
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
void tst_QMimeDatabase::installNewLocalMimeType()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("This test requires QProcess support");
#else
qmime_secondsBetweenChecks = 0;
@@ -1057,7 +1057,7 @@ void tst_QMimeDatabase::installNewLocalMimeType()
QCOMPARE(db.mimeTypeForFile(QLatin1String("foo.ymu"), QMimeDatabase::MatchExtension).name(),
QString::fromLatin1("application/octet-stream"));
QVERIFY(!db.mimeTypeForName(QLatin1String("text/x-suse-ymp")).isValid());
-#endif
+#endif // QT_CONFIG(process)
}
QTEST_GUILESS_MAIN(tst_QMimeDatabase)
diff --git a/tests/auto/corelib/plugin/quuid/tst_quuid.cpp b/tests/auto/corelib/plugin/quuid/tst_quuid.cpp
index e2c137e25f..cb45336d4c 100644
--- a/tests/auto/corelib/plugin/quuid/tst_quuid.cpp
+++ b/tests/auto/corelib/plugin/quuid/tst_quuid.cpp
@@ -91,7 +91,7 @@ void tst_QUuid::initTestCase()
//"{1ab6e93a-b1cb-4a87-ba47-ec7e99039a7b}";
uuidB = QUuid(0x1ab6e93a, 0xb1cb, 0x4a87, 0xba, 0x47, 0xec, 0x7e, 0x99, 0x03, 0x9a, 0x7b);
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
// chdir to the directory containing our testdata, then refer to it with relative paths
QString testdata_dir = QFileInfo(QFINDTESTDATA("testProcessUniqueness")).absolutePath();
QVERIFY2(QDir::setCurrent(testdata_dir), qPrintable("Could not chdir to " + testdata_dir));
@@ -338,7 +338,7 @@ void tst_QUuid::threadUniqueness()
void tst_QUuid::processUniqueness()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
QProcess process;
diff --git a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
index 49a3b3e4db..403e28b07b 100644
--- a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
+++ b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
@@ -76,7 +76,7 @@ int Pointer::count = 0;
void tst_QThreadStorage::initTestCase()
{
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
const QString crashOnExitDir = QFINDTESTDATA("crashonexit");
QVERIFY2(!crashOnExitDir.isEmpty(),
qPrintable(QString::fromLatin1("Could not find 'crashonexit' starting from '%1'")
@@ -300,7 +300,7 @@ void tst_QThreadStorage::ensureCleanupOrder()
QVERIFY(First::order < Second::order);
}
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
static inline bool runCrashOnExit(const QString &binary, QString *errorMessage)
{
const int timeout = 60000;
@@ -325,7 +325,7 @@ static inline bool runCrashOnExit(const QString &binary, QString *errorMessage)
void tst_QThreadStorage::crashOnExit()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
QString errorMessage;
diff --git a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
index a54ad3d9c9..10398f1a99 100644
--- a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
+++ b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
@@ -509,7 +509,7 @@ void tst_QCommandLineParser::testCpp11StyleInitialization()
void tst_QCommandLineParser::testVersionOption()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("This test requires QProcess support");
#else
#if defined(Q_OS_ANDROID)
@@ -526,7 +526,7 @@ void tst_QCommandLineParser::testVersionOption()
output.replace(QStringLiteral("\r\n"), QStringLiteral("\n"));
#endif
QCOMPARE(output, QString("qcommandlineparser_test_helper 1.0\n"));
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
static const char expectedOptionsHelp[] =
@@ -575,7 +575,7 @@ void tst_QCommandLineParser::testHelpOption_data()
void tst_QCommandLineParser::testHelpOption()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("This test requires QProcess support");
#else
#if defined(Q_OS_ANDROID)
@@ -618,12 +618,12 @@ void tst_QCommandLineParser::testHelpOption()
expectedResizeHelp.replace("testhelper/", "testhelper\\");
#endif
QCOMPARE(output, QString(expectedResizeHelp));
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
void tst_QCommandLineParser::testQuoteEscaping()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("This test requires QProcess support");
#elif defined(Q_OS_ANDROID)
QSKIP("Deploying executable applications to file system on Android not supported.");
@@ -644,7 +644,7 @@ void tst_QCommandLineParser::testQuoteEscaping()
QVERIFY2(output.contains("KEY1=\"VALUE1\""), qPrintable(output));
QVERIFY2(output.contains("QTBUG-15379=C:\\path\\'file.ext"), qPrintable(output));
QVERIFY2(output.contains("QTBUG-30628=C:\\temp\\'file'.ext"), qPrintable(output));
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
QTEST_APPLESS_MAIN(tst_QCommandLineParser)
diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
index 42bfb3603d..06b0fe8d51 100644
--- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
@@ -35,7 +35,9 @@
#include <QScopedArrayPointer>
#include <qtextcodec.h>
#include <qdatetime.h>
-#include <qprocess.h>
+#if QT_CONFIG(process)
+# include <qprocess.h>
+#endif
#include <float.h>
#include <locale.h>
@@ -152,7 +154,7 @@ tst_QLocale::tst_QLocale()
void tst_QLocale::initTestCase()
{
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
const QString syslocaleapp_dir = QFINDTESTDATA("syslocaleapp");
QVERIFY2(!syslocaleapp_dir.isEmpty(),
qPrintable(QStringLiteral("Cannot find 'syslocaleapp' starting from ")
@@ -165,7 +167,7 @@ void tst_QLocale::initTestCase()
QVERIFY2(fi.exists() && fi.isExecutable(),
qPrintable(QDir::toNativeSeparators(m_sysapp)
+ QStringLiteral(" does not exist or is not executable.")));
-#endif // QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
void tst_QLocale::cleanupTestCase()
@@ -420,7 +422,7 @@ void tst_QLocale::ctor()
#undef TEST_CTOR
}
-#if !defined(QT_NO_PROCESS)
+#if QT_CONFIG(process)
static inline bool runSysApp(const QString &binary,
const QStringList &env,
QString *output,
@@ -472,7 +474,7 @@ static inline bool runSysAppTest(const QString &binary,
void tst_QLocale::emptyCtor()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
#define TEST_CTOR(req_lc, exp_str) \
diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
index 7bebe5e9e0..e8f56fc1d3 100644
--- a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
@@ -31,7 +31,9 @@
#include <QtCore/QTemporaryFile>
#include <QtCore/QTemporaryDir>
-#include <QtCore/QProcess>
+#if QT_CONFIG(process)
+# include <QtCore/QProcess>
+#endif
#include <QtCore/QByteArray>
#include <QtCore/QString>
#include <QtCore/QFileInfo>
@@ -66,7 +68,7 @@ static QString makespec()
QT_BEGIN_NAMESPACE
namespace QTest {
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
class QExternalProcess: public QProcess
{
protected:
@@ -87,7 +89,7 @@ namespace QTest {
}
#endif
};
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
class QExternalTestPrivate
{
@@ -554,7 +556,7 @@ namespace QTest {
bool QExternalTestPrivate::runQmake()
{
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
if (temporaryDirPath.isEmpty())
qWarning() << "Temporary directory is expected to be non-empty";
@@ -597,14 +599,14 @@ namespace QTest {
}
return ok && exitCode == 0;
-#else // QT_NO_PROCESS
+#else // QT_CONFIG(process)
return false;
-#endif // QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
bool QExternalTestPrivate::runMake(Target target)
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
return false;
#else
if (temporaryDirPath.isEmpty())
@@ -663,7 +665,7 @@ namespace QTest {
std_err += make.readAllStandardError();
return ok;
-#endif // !QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
bool QExternalTestPrivate::commonSetup(const QByteArray &body)