diff options
Diffstat (limited to 'tests/auto/corelib')
11 files changed, 92 insertions, 33 deletions
diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp index 01d23e8aa2..c96e933f0e 100644 --- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp +++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp @@ -84,7 +84,7 @@ private slots: void codecForUtfText_data(); void codecForUtfText(); -#if defined(Q_OS_UNIX) && !defined(QT_NO_PROCESS) +#if defined(Q_OS_UNIX) void toLocal8Bit(); #endif @@ -2070,9 +2070,12 @@ void tst_QTextCodec::codecForUtfText() QVERIFY(codec == 0); } -#if defined(Q_OS_UNIX) && !defined(QT_NO_PROCESS) +#if defined(Q_OS_UNIX) void tst_QTextCodec::toLocal8Bit() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QProcess process; process.start("echo/echo"); QString string(QChar(0x410)); @@ -2082,6 +2085,7 @@ void tst_QTextCodec::toLocal8Bit() process.waitForFinished(); QCOMPARE(process.exitStatus(), QProcess::NormalExit); QCOMPARE(process.exitCode(), 0); +#endif } #endif diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index a0609d67ac..98963108be 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -139,7 +139,7 @@ private slots: void readAll_data(); void readAll(); void readAllBuffer(); -#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS) +#if !defined(Q_OS_WINCE) void readAllStdin(); void readLineStdin(); void readLineStdin_lineByLine(); @@ -868,9 +868,12 @@ void tst_QFile::readAllBuffer() QFile::remove(fileName); } -#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS) +#if !defined(Q_OS_WINCE) void tst_QFile::readAllStdin() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QByteArray lotsOfData(1024, '@'); // 10 megs QProcess process; @@ -887,11 +890,14 @@ void tst_QFile::readAllStdin() process.closeWriteChannel(); process.waitForFinished(); QCOMPARE(process.readAll().size(), lotsOfData.size() * 5); +#endif } void tst_QFile::readLineStdin() { - +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QByteArray lotsOfData(1024, '@'); // 10 megs for (int i = 0; i < lotsOfData.size(); ++i) { if ((i % 32) == 31) @@ -926,10 +932,14 @@ void tst_QFile::readLineStdin() QCOMPARE(char(array[i]), char('0' + i % 32)); } } +#endif } void tst_QFile::readLineStdin_lineByLine() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else for (int i = 0; i < 2; ++i) { QProcess process; process.start(m_stdinProcessDir + QStringLiteral("/stdinprocess"), @@ -949,6 +959,7 @@ void tst_QFile::readLineStdin_lineByLine() process.closeWriteChannel(); QVERIFY(process.waitForFinished(5000)); } +#endif } #endif diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 05546eb2b7..62e183f619 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -219,10 +219,8 @@ private slots: void fileTimes(); void fileTimes_oldFile(); -#ifndef Q_NO_SYMLINKS void isSymLink_data(); void isSymLink(); -#endif void isHidden_data(); void isHidden(); @@ -1206,9 +1204,9 @@ void tst_QFileInfo::fileTimes_oldFile() #endif } -#ifndef Q_NO_SYMLINKS void tst_QFileInfo::isSymLink_data() { +#ifndef Q_NO_SYMLINKS QFile::remove("link.lnk"); QFile::remove("brokenlink.lnk"); QFile::remove("dummyfile"); @@ -1228,10 +1226,14 @@ void tst_QFileInfo::isSymLink_data() QTest::newRow("existent file") << m_sourceFile << false << ""; QTest::newRow("link") << "link.lnk" << true << QFileInfo(m_sourceFile).absoluteFilePath(); QTest::newRow("broken link") << "brokenlink.lnk" << true << QFileInfo("dummyfile").absoluteFilePath(); +#endif } void tst_QFileInfo::isSymLink() { +#ifdef Q_NO_SYMLINKS + QSKIP("No symlink support", SkipAll); +#else QFETCH(QString, path); QFETCH(bool, isSymLink); QFETCH(QString, linkTarget); @@ -1239,8 +1241,8 @@ void tst_QFileInfo::isSymLink() QFileInfo fi(path); QCOMPARE(fi.isSymLink(), isSymLink); QCOMPARE(fi.symLinkTarget(), linkTarget); -} #endif +} void tst_QFileInfo::isHidden_data() { diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp index 63d07a7ce3..aa7a3762ce 100644 --- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp @@ -187,7 +187,7 @@ private slots: void pos(); void pos2(); void pos3LargeFile(); -#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS) +#if !defined(Q_OS_WINCE) void readStdin(); void readAllFromStdin(); void readLineFromStdin(); @@ -1484,9 +1484,12 @@ void tst_QTextStream::pos3LargeFile() // ------------------------------------------------------------------------------ // Qt/CE has no stdin/out support for processes -#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS) +#if !defined(Q_OS_WINCE) void tst_QTextStream::readStdin() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QProcess stdinProcess; stdinProcess.start("stdinProcess/stdinProcess"); stdinProcess.setReadChannel(QProcess::StandardError); @@ -1505,12 +1508,16 @@ void tst_QTextStream::readStdin() QCOMPARE(a, 1); QCOMPARE(b, 2); QCOMPARE(c, 3); +#endif } // ------------------------------------------------------------------------------ // Qt/CE has no stdin/out support for processes void tst_QTextStream::readAllFromStdin() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QProcess stdinProcess; stdinProcess.start("readAllStdinProcess/readAllStdinProcess", QIODevice::ReadWrite | QIODevice::Text); stdinProcess.setReadChannel(QProcess::StandardError); @@ -1523,12 +1530,16 @@ void tst_QTextStream::readAllFromStdin() QVERIFY(stdinProcess.waitForFinished(5000)); QCOMPARE(stream.readAll(), QString::fromLatin1("hello world\n")); +#endif } // ------------------------------------------------------------------------------ // Qt/CE has no stdin/out support for processes void tst_QTextStream::readLineFromStdin() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QProcess stdinProcess; stdinProcess.start("readLineStdinProcess/readLineStdinProcess", QIODevice::ReadWrite | QIODevice::Text); stdinProcess.setReadChannel(QProcess::StandardError); @@ -1544,6 +1555,7 @@ void tst_QTextStream::readLineFromStdin() stdinProcess.closeWriteChannel(); QVERIFY(stdinProcess.waitForFinished(5000)); +#endif } #endif diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 24cfe8f3bc..94242607f0 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -91,9 +91,7 @@ private slots: void floatProperty(); void qrealProperty(); void property(); -#ifndef QT_NO_PROCESS void recursiveSignalEmission(); -#endif void signalBlocking(); void blockingQueuedConnection(); void childEvents(); @@ -2981,9 +2979,11 @@ void tst_QObject::dynamicProperties() QVERIFY(obj.dynamicPropertyNames().isEmpty()); } -#ifndef QT_NO_PROCESS void tst_QObject::recursiveSignalEmission() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QProcess proc; // signalbug helper app should always be next to this test binary const QString path = QStringLiteral("signalbug/signalbug"); @@ -2992,8 +2992,8 @@ void tst_QObject::recursiveSignalEmission() QVERIFY(proc.waitForFinished()); QVERIFY(proc.exitStatus() == QProcess::NormalExit); QCOMPARE(proc.exitCode(), 0); -} #endif +} void tst_QObject::signalBlocking() { diff --git a/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp b/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp index 5a92c2f0cb..26bb70fc66 100644 --- a/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp +++ b/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp @@ -74,7 +74,7 @@ private slots: void removeWhileAttached(); #endif void emptyMemory(); -#if !defined(Q_OS_WIN) && !defined(QT_NO_PROCESS) +#if !defined(Q_OS_WIN) void readOnly(); #endif @@ -90,10 +90,8 @@ private slots: void simpleThreadedProducerConsumer(); // with processes -#ifndef QT_NO_PROCESS void simpleProcessProducerConsumer_data(); void simpleProcessProducerConsumer(); -#endif // extreme cases void useTooMuchMemory(); @@ -457,9 +455,12 @@ void tst_QSharedMemory::emptyMemory() by writing to data and causing a segfault. */ // This test opens a crash dialog on Windows. -#if !defined(Q_OS_WIN) && !defined(QT_NO_PROCESS) +#if !defined(Q_OS_WIN) void tst_QSharedMemory::readOnly() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else rememberKey("readonly_segfault"); // ### on windows disable the popup somehow QProcess p; @@ -467,6 +468,7 @@ void tst_QSharedMemory::readOnly() p.setProcessChannelMode(QProcess::ForwardedChannels); p.waitForFinished(); QCOMPARE(p.error(), QProcess::Crashed); +#endif } #endif @@ -738,15 +740,16 @@ void tst_QSharedMemory::simpleThreadedProducerConsumer() } } -#ifndef QT_NO_PROCESS void tst_QSharedMemory::simpleProcessProducerConsumer_data() { +#ifndef QT_NO_PROCESS QTest::addColumn<int>("processes"); int tries = 5; for (int i = 0; i < tries; ++i) { QTest::newRow("1 process") << 1; QTest::newRow("5 processes") << 5; } +#endif } /*! @@ -754,6 +757,9 @@ void tst_QSharedMemory::simpleProcessProducerConsumer_data() */ void tst_QSharedMemory::simpleProcessProducerConsumer() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QFETCH(int, processes); QSKIP("This test is unstable: QTBUG-25655"); @@ -797,8 +803,8 @@ void tst_QSharedMemory::simpleProcessProducerConsumer() producer.write("", 1); producer.waitForBytesWritten(); QVERIFY(producer.waitForFinished(5000)); -} #endif +} void tst_QSharedMemory::uniqueKey_data() { diff --git a/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp b/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp index b2198e9267..169a13aff2 100644 --- a/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp +++ b/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp @@ -59,7 +59,6 @@ private slots: void complexacquire(); void release(); -#ifndef QT_NO_PROCESS void basicProcesses(); void processes_data(); @@ -69,7 +68,6 @@ private slots: void undo(); #endif void initialValue(); -#endif // QT_NO_PROCESS private: static QString helperBinary(); @@ -177,9 +175,11 @@ void tst_QSystemSemaphore::release() QCOMPARE(sem.errorString(), QString()); } -#ifndef QT_NO_PROCESS void tst_QSystemSemaphore::basicProcesses() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QSystemSemaphore sem("store", 0, QSystemSemaphore::Create); QProcess acquire; @@ -198,6 +198,7 @@ void tst_QSystemSemaphore::basicProcesses() acquire.waitForFinished(HELPERWAITTIME); release.waitForFinished(HELPERWAITTIME); QVERIFY(acquire.state() == QProcess::NotRunning); +#endif } void tst_QSystemSemaphore::processes_data() @@ -212,6 +213,9 @@ void tst_QSystemSemaphore::processes_data() void tst_QSystemSemaphore::processes() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QSystemSemaphore sem("store", 1, QSystemSemaphore::Create); QFETCH(int, processes); @@ -231,12 +235,16 @@ void tst_QSystemSemaphore::processes() QCOMPARE(consumers.first()->exitCode(), 0); delete consumers.takeFirst(); } +#endif } // This test only checks a system v unix behavior. #if !defined(Q_OS_WIN) && !defined(QT_POSIX_IPC) void tst_QSystemSemaphore::undo() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QSystemSemaphore sem("store", 1, QSystemSemaphore::Create); QStringList acquireArguments = QStringList("acquire"); @@ -253,11 +261,15 @@ void tst_QSystemSemaphore::undo() QVERIFY2(acquire.waitForStarted(), "Could not start helper binary"); acquire.waitForFinished(HELPERWAITTIME); QVERIFY(acquire.state()== QProcess::NotRunning); +#endif } #endif void tst_QSystemSemaphore::initialValue() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QSystemSemaphore sem("store", 1, QSystemSemaphore::Create); QStringList acquireArguments = QStringList("acquire"); @@ -284,8 +296,8 @@ void tst_QSystemSemaphore::initialValue() acquire.waitForFinished(HELPERWAITTIME); release.waitForFinished(HELPERWAITTIME); QVERIFY(acquire.state()== QProcess::NotRunning); -} #endif +} QString tst_QSystemSemaphore::helperBinary() { 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 0fb1f91e3b..7f78312582 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 @@ -41,7 +41,11 @@ void tst_QMimeDatabase::init() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else const QString mimeDirName = m_globalXdgDir + QStringLiteral("/mime"); runUpdateMimeDatabase(mimeDirName); QVERIFY(QFile::exists(mimeDirName + QStringLiteral("/mime.cache"))); +#endif } diff --git a/tests/auto/corelib/plugin/quuid/tst_quuid.cpp b/tests/auto/corelib/plugin/quuid/tst_quuid.cpp index 2c70911274..8f37b265f6 100644 --- a/tests/auto/corelib/plugin/quuid/tst_quuid.cpp +++ b/tests/auto/corelib/plugin/quuid/tst_quuid.cpp @@ -66,9 +66,7 @@ private slots: void versions(); void threadUniqueness(); -#ifndef QT_NO_PROCESS void processUniqueness(); -#endif void hash(); @@ -325,9 +323,11 @@ void tst_QUuid::threadUniqueness() qDeleteAll(threads); } -#ifndef QT_NO_PROCESS void tst_QUuid::processUniqueness() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QProcess process; QString processOneOutput; QString processTwoOutput; @@ -352,8 +352,8 @@ void tst_QUuid::processUniqueness() // They should be *different*! QVERIFY(processOneOutput != processTwoOutput); -} #endif +} void tst_QUuid::hash() { diff --git a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp index 8a315af850..ac606acfc9 100644 --- a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp +++ b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp @@ -63,9 +63,7 @@ private slots: void autoDelete(); void adoptedThreads(); void ensureCleanupOrder(); -#ifndef QT_NO_PROCESS void crashOnExit(); -#endif void leakInDestructor(); void resetInDestructor(); void valueBased(); @@ -320,14 +318,18 @@ static inline bool runCrashOnExit(const QString &binary, QString *errorMessage) } return true; } +#endif void tst_QThreadStorage::crashOnExit() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QString errorMessage; QVERIFY2(runCrashOnExit(m_crashOnExit, &errorMessage), qPrintable(errorMessage)); -} #endif +} // S stands for thread Safe. class SPointer diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index 1c96aaba98..5b9c9e0b36 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -134,7 +134,7 @@ private slots: #endif void ctor(); -#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS) +#if !defined(Q_OS_WINCE) void emptyCtor(); #endif void legacyNames(); @@ -499,9 +499,14 @@ static inline bool runSysAppTest(const QString &binary, } return true; } +#endif +#if !defined(Q_OS_WINCE) void tst_QLocale::emptyCtor() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else #define TEST_CTOR(req_lc, exp_str) \ { \ /* Test constructor without arguments. Needs separate process */ \ @@ -570,6 +575,7 @@ void tst_QLocale::emptyCtor() #endif // Q_OS_BLACKBERRY #undef TEST_CTOR +#endif } #endif |