Check existence of QProcess feature before using it on Qt autotests.
VxWorks does not have QProcess support.
Change-Id: I917b769f967e9d71ec5025aae788f3e237b07aeb
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
(cherry picked from commit 416e73a0fc)
bb10
parent
e778042ed7
commit
f3fc2078b8
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -75,7 +75,9 @@ private slots:
|
|||
void sessionClosing_data();
|
||||
void sessionClosing();
|
||||
|
||||
#ifndef QT_NO_PROCESS
|
||||
void outOfProcessSession();
|
||||
#endif
|
||||
void invalidSession();
|
||||
|
||||
void repeatedOpenClose_data();
|
||||
|
|
@ -901,6 +903,7 @@ QDebug operator<<(QDebug debug, const QList<QNetworkConfiguration> &list)
|
|||
|
||||
// Note: outOfProcessSession requires that at least one configuration is
|
||||
// at Discovered -state.
|
||||
#ifndef QT_NO_PROCESS
|
||||
void tst_QNetworkSession::outOfProcessSession()
|
||||
{
|
||||
updateConfigurations();
|
||||
|
|
@ -998,6 +1001,7 @@ void tst_QNetworkSession::outOfProcessSession()
|
|||
QSKIP("Lackey failed");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// A convenience / helper function for testcases. Return the first matching configuration.
|
||||
// Ignores configurations in other than 'discovered' -state. Returns invalid (QNetworkConfiguration())
|
||||
|
|
|
|||
|
|
@ -975,6 +975,7 @@ void tst_NetworkSelfTest::smbServer()
|
|||
QCOMPARE(ret, strlen(contents));
|
||||
QVERIFY(memcmp(buf, contents, strlen(contents)) == 0);
|
||||
#else
|
||||
#ifndef QT_NO_PROCESS
|
||||
// try to use Samba
|
||||
QString progname = "smbclient";
|
||||
QProcess smbclient;
|
||||
|
|
@ -1012,6 +1013,9 @@ void tst_NetworkSelfTest::smbServer()
|
|||
output = smbclient.readAll();
|
||||
QCOMPARE(output.constData(), contents);
|
||||
qDebug() << "Test file is correct";
|
||||
#else
|
||||
QSKIP( "No QProcess support", SkipAll);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2142,6 +2142,7 @@ void tst_QApplication::qtbug_12673()
|
|||
QVERIFY2(!path.isEmpty(), "Cannot locate modal helper application");
|
||||
path += "modal";
|
||||
|
||||
#ifndef QT_NO_PROCESS
|
||||
QProcess testProcess;
|
||||
QStringList arguments;
|
||||
testProcess.start(path, arguments);
|
||||
|
|
@ -2149,6 +2150,9 @@ void tst_QApplication::qtbug_12673()
|
|||
qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, testProcess.errorString())));
|
||||
QVERIFY(testProcess.waitForFinished(20000));
|
||||
QCOMPARE(testProcess.exitStatus(), QProcess::NormalExit);
|
||||
#else
|
||||
QSKIP( "No QProcess support", SkipAll);
|
||||
#endif
|
||||
}
|
||||
|
||||
class NoQuitOnHideWidget : public QWidget
|
||||
|
|
@ -2222,7 +2226,9 @@ void tst_QApplication::abortQuitOnShow()
|
|||
executed *after* the destruction of QApplication.
|
||||
*/
|
||||
Q_GLOBAL_STATIC(QLocale, tst_qapp_locale);
|
||||
#ifndef QT_NO_PROCESS
|
||||
Q_GLOBAL_STATIC(QProcess, tst_qapp_process);
|
||||
#endif
|
||||
Q_GLOBAL_STATIC(QFileSystemWatcher, tst_qapp_fileSystemWatcher);
|
||||
#ifndef QT_NO_SHAREDMEMORY
|
||||
Q_GLOBAL_STATIC(QSharedMemory, tst_qapp_sharedMemory);
|
||||
|
|
@ -2243,7 +2249,9 @@ void tst_QApplication::globalStaticObjectDestruction()
|
|||
int argc = 1;
|
||||
QApplication app(argc, &argv0);
|
||||
QVERIFY(tst_qapp_locale());
|
||||
#ifndef QT_NO_PROCESS
|
||||
QVERIFY(tst_qapp_process());
|
||||
#endif
|
||||
QVERIFY(tst_qapp_fileSystemWatcher());
|
||||
#ifndef QT_NO_SHAREDMEMORY
|
||||
QVERIFY(tst_qapp_sharedMemory());
|
||||
|
|
|
|||
|
|
@ -201,7 +201,9 @@ private slots:
|
|||
void deleteStack();
|
||||
void checkSignals();
|
||||
void addStackAndDie();
|
||||
#ifndef QT_NO_PROCESS
|
||||
void commandTextFormat();
|
||||
#endif
|
||||
};
|
||||
|
||||
tst_QUndoGroup::tst_QUndoGroup()
|
||||
|
|
@ -605,6 +607,7 @@ void tst_QUndoGroup::addStackAndDie()
|
|||
delete stack;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_PROCESS
|
||||
void tst_QUndoGroup::commandTextFormat()
|
||||
{
|
||||
QString binDir = QLibraryInfo::location(QLibraryInfo::BinariesPath);
|
||||
|
|
@ -644,6 +647,7 @@ void tst_QUndoGroup::commandTextFormat()
|
|||
|
||||
qApp->removeTranslator(&translator);
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
class tst_QUndoGroup : public QObject
|
||||
|
|
|
|||
|
|
@ -247,7 +247,9 @@ private slots:
|
|||
void macroBeginEnd();
|
||||
void compression();
|
||||
void undoLimit();
|
||||
#ifndef QT_NO_PROCESS
|
||||
void commandTextFormat();
|
||||
#endif
|
||||
void separateUndoText();
|
||||
};
|
||||
|
||||
|
|
@ -2964,6 +2966,7 @@ void tst_QUndoStack::undoLimit()
|
|||
true); // redoChanged
|
||||
}
|
||||
|
||||
#ifndef QT_NO_PROCESS
|
||||
void tst_QUndoStack::commandTextFormat()
|
||||
{
|
||||
QString binDir = QLibraryInfo::location(QLibraryInfo::BinariesPath);
|
||||
|
|
@ -3001,6 +3004,7 @@ void tst_QUndoStack::commandTextFormat()
|
|||
|
||||
qApp->removeTranslator(&translator);
|
||||
}
|
||||
#endif
|
||||
|
||||
void tst_QUndoStack::separateUndoText()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue