summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
diff options
context:
space:
mode:
authorPasi Petäjäjärvi <pasi.petajajarvi@digia.com>2013-01-16 14:34:35 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-23 10:38:59 +0100
commit416e73a0fcaf31f7c32ba7dcd214b62e6060123c (patch)
tree1be730c488c0f979a5ab1ffb40631489a5a9c94b /tests/auto/corelib
parent2d2da44f6381fdeaa195319c0dc66e3909c2ca7b (diff)
Check existence of QProcess feature before using it on Qt autotests.
VxWorks does not have QProcess support. Change-Id: I20ed479125097d468a1aa50afb18c3749f0fbb98 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r--tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp5
-rw-r--r--tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp8
-rw-r--r--tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp8
-rw-r--r--tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp4
-rw-r--r--tests/auto/corelib/plugin/quuid/tst_quuid.cpp4
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp4
6 files changed, 25 insertions, 8 deletions
diff --git a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp
index 3826bfc4e2..b00cdc64b8 100644
--- a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp
+++ b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp
@@ -43,6 +43,10 @@
#include <QObject>
#include <QProcessEnvironment>
+#ifdef QT_NO_PROCESS
+QTEST_NOOP_MAIN
+#else
+
class tst_QProcessEnvironment: public QObject
{
Q_OBJECT
@@ -318,3 +322,4 @@ void tst_QProcessEnvironment::putenv()
QTEST_MAIN(tst_QProcessEnvironment)
#include "tst_qprocessenvironment.moc"
+#endif
diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
index bcbd257de3..43ce7f7a45 100644
--- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
+++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
@@ -194,7 +194,7 @@ private slots:
void pos();
void pos2();
void pos3LargeFile();
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS)
void readStdin();
void readAllFromStdin();
void readLineFromStdin();
@@ -1386,8 +1386,8 @@ void tst_QTextStream::pos3LargeFile()
}
// ------------------------------------------------------------------------------
-#ifndef Q_OS_WINCE
// Qt/CE has no stdin/out support for processes
+#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS)
void tst_QTextStream::readStdin()
{
QProcess stdinProcess;
@@ -1409,10 +1409,8 @@ void tst_QTextStream::readStdin()
QCOMPARE(b, 2);
QCOMPARE(c, 3);
}
-#endif
// ------------------------------------------------------------------------------
-#ifndef Q_OS_WINCE
// Qt/CE has no stdin/out support for processes
void tst_QTextStream::readAllFromStdin()
{
@@ -1430,10 +1428,8 @@ void tst_QTextStream::readAllFromStdin()
QChar quoteChar('"');
QCOMPARE(stream.readAll(), QString::fromLatin1("%1hello world%2 \n").arg(quoteChar).arg(quoteChar));
}
-#endif
// ------------------------------------------------------------------------------
-#ifndef Q_OS_WINCE
// Qt/CE has no stdin/out support for processes
void tst_QTextStream::readLineFromStdin()
{
diff --git a/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp b/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp
index baeb6e1666..2cefa7a6a0 100644
--- a/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp
+++ b/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp
@@ -82,7 +82,7 @@ private slots:
void removeWhileAttached();
#endif
void emptyMemory();
-#ifndef Q_OS_WIN
+#if !defined(Q_OS_WIN) && !defined(QT_NO_PROCESS)
void readOnly();
#endif
@@ -98,8 +98,10 @@ private slots:
void simpleThreadedProducerConsumer();
// with processes
+#ifndef QT_NO_PROCESS
void simpleProcessProducerConsumer_data();
void simpleProcessProducerConsumer();
+#endif
// extreme cases
void useTooMuchMemory();
@@ -447,7 +449,7 @@ void tst_QSharedMemory::emptyMemory()
by writing to data and causing a segfault.
*/
// This test opens a crash dialog on Windows.
-#ifndef Q_OS_WIN
+#if !defined(Q_OS_WIN) && !defined(QT_NO_PROCESS)
void tst_QSharedMemory::readOnly()
{
rememberKey("readonly_segfault");
@@ -728,6 +730,7 @@ void tst_QSharedMemory::simpleThreadedProducerConsumer()
}
}
+#ifndef QT_NO_PROCESS
void tst_QSharedMemory::simpleProcessProducerConsumer_data()
{
QTest::addColumn<int>("processes");
@@ -785,6 +788,7 @@ void tst_QSharedMemory::simpleProcessProducerConsumer()
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 297955366c..1638c1d462 100644
--- a/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp
+++ b/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp
@@ -66,6 +66,7 @@ private slots:
void basicacquire();
void complexacquire();
+#ifndef QT_NO_PROCESS
void basicProcesses();
void processes_data();
@@ -75,6 +76,7 @@ private slots:
void undo();
#endif
void initialValue();
+#endif // QT_NO_PROCESS
private:
QString helperBinary();
@@ -154,6 +156,7 @@ void tst_QSystemSemaphore::complexacquire()
QCOMPARE(sem.errorString(), QString());
}
+#ifndef QT_NO_PROCESS
void tst_QSystemSemaphore::basicProcesses()
{
QSystemSemaphore sem("store", 0, QSystemSemaphore::Create);
@@ -261,6 +264,7 @@ void tst_QSystemSemaphore::initialValue()
release.waitForFinished(HELPERWAITTIME);
QVERIFY(acquire.state()== QProcess::NotRunning);
}
+#endif
QString tst_QSystemSemaphore::helperBinary()
{
diff --git a/tests/auto/corelib/plugin/quuid/tst_quuid.cpp b/tests/auto/corelib/plugin/quuid/tst_quuid.cpp
index 06b06bc464..aea86f76d1 100644
--- a/tests/auto/corelib/plugin/quuid/tst_quuid.cpp
+++ b/tests/auto/corelib/plugin/quuid/tst_quuid.cpp
@@ -73,7 +73,9 @@ private slots:
void versions();
void threadUniqueness();
+#ifndef QT_NO_PROCESS
void processUniqueness();
+#endif
void hash();
@@ -319,6 +321,7 @@ void tst_QUuid::threadUniqueness()
qDeleteAll(threads);
}
+#ifndef QT_NO_PROCESS
void tst_QUuid::processUniqueness()
{
QProcess process;
@@ -346,6 +349,7 @@ 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 7854339e4c..a64ba11eae 100644
--- a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
+++ b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
@@ -71,7 +71,9 @@ private slots:
void autoDelete();
void adoptedThreads();
void ensureCleanupOrder();
+#ifndef QT_NO_PROCESS
void crashOnExit();
+#endif
void leakInDestructor();
void resetInDestructor();
void valueBased();
@@ -305,6 +307,7 @@ void tst_QThreadStorage::ensureCleanupOrder()
QVERIFY(First::order < Second::order);
}
+#ifndef QT_NO_PROCESS
static inline bool runCrashOnExit(const QString &binary, QString *errorMessage)
{
const int timeout = 60000;
@@ -332,6 +335,7 @@ void tst_QThreadStorage::crashOnExit()
QVERIFY2(runCrashOnExit(m_crashOnExit, &errorMessage),
qPrintable(errorMessage));
}
+#endif
// S stands for thread Safe.
class SPointer