diff options
author | Marko Kangas <marko.kangas@theqtcompany.com> | 2015-02-13 13:01:57 +0200 |
---|---|---|
committer | Marko Kangas <marko.kangas@theqtcompany.com> | 2015-03-16 09:34:15 +0000 |
commit | bc69fd1dfe30876909091d93a07640a498a24c0c (patch) | |
tree | 6af7b94832fcd5c596e54338266d43772ca152e6 /tests/auto/network | |
parent | f1b3244ac16cd5b306450c53fcbd4ee673bfe53b (diff) |
Skip instead of entirely excluding tests with disabled features
Properly QSKIP tests that use disabled QProcess and symlink
features instead of excluding them silently by #ifdef.
Other reason is that moc doesn't respect QT_NO_* defines
in class definition which causes build issues on some
platforms.
Change-Id: I041020f7452f7d36c7ec8a5866a4ba5eb23d1f94
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Diffstat (limited to 'tests/auto/network')
5 files changed, 30 insertions, 22 deletions
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 3c3c5755eb..c63cfaf6b6 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -294,10 +294,8 @@ private Q_SLOTS: void ioPutToFileFromSocket(); void ioPutToFileFromLocalSocket_data(); void ioPutToFileFromLocalSocket(); -#ifndef QT_NO_PROCESS void ioPutToFileFromProcess_data(); void ioPutToFileFromProcess(); -#endif void ioPutToFtpFromFile_data(); void ioPutToFtpFromFile(); void ioPutToHttpFromFile_data(); @@ -4276,14 +4274,19 @@ void tst_QNetworkReply::ioPutToFileFromLocalSocket() } // Currently no stdin/out supported for Windows CE. -#ifndef QT_NO_PROCESS void tst_QNetworkReply::ioPutToFileFromProcess_data() { +#ifndef QT_NO_PROCESS putToFile_data(); +#endif } void tst_QNetworkReply::ioPutToFileFromProcess() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else + #if defined(Q_OS_WINCE) QSKIP("Currently no stdin/out supported for Windows CE"); #else @@ -4321,8 +4324,9 @@ void tst_QNetworkReply::ioPutToFileFromProcess() QByteArray contents = file.readAll(); QCOMPARE(contents, data); #endif + +#endif // QT_NO_PROCESS } -#endif void tst_QNetworkReply::ioPutToFtpFromFile_data() { diff --git a/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp b/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp index 4fee41ca8b..2fd80b3e71 100644 --- a/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp +++ b/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp @@ -67,9 +67,7 @@ private slots: void sessionClosing_data(); void sessionClosing(); -#ifndef QT_NO_PROCESS void outOfProcessSession(); -#endif void invalidSession(); void repeatedOpenClose_data(); @@ -899,9 +897,11 @@ 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() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else updateConfigurations(); QTest::qWait(2000); @@ -996,8 +996,8 @@ void tst_QNetworkSession::outOfProcessSession() default: 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()) diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp index e0020c2968..4881d86937 100644 --- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -88,10 +88,8 @@ private slots: void threadedConnection_data(); void threadedConnection(); -#ifndef QT_NO_PROCESS void processConnection_data(); void processConnection(); -#endif void longPath(); void waitForDisconnect(); @@ -784,7 +782,6 @@ void tst_QLocalSocket::threadedConnection() } } -#ifndef QT_NO_PROCESS void tst_QLocalSocket::processConnection_data() { QTest::addColumn<int>("processes"); @@ -794,6 +791,7 @@ void tst_QLocalSocket::processConnection_data() QTest::newRow("30 clients") << 30; } +#ifndef QT_NO_PROCESS class ProcessOutputDumper { public: @@ -815,12 +813,16 @@ public: private: QProcess *process; }; +#endif /*! Create external processes that produce and consume. */ void tst_QLocalSocket::processConnection() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else #ifdef Q_OS_MAC QSKIP("The processConnection test is unstable on Mac. See QTBUG-39986."); #endif @@ -860,8 +862,8 @@ void tst_QLocalSocket::processConnection() } producer.waitForFinished(15000); producerOutputDumper.clear(); -} #endif +} void tst_QLocalSocket::longPath() { diff --git a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp index 804f86b479..e0a6e3699d 100644 --- a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp @@ -96,9 +96,7 @@ private slots: void setSocketDescriptor(); #endif void listenWhileListening(); -#ifndef QT_NO_PROCESS void addressReusable(); -#endif void setNewSocketDescriptorBlocking(); #ifndef QT_NO_NETWORKPROXY void invalidProxy_data(); @@ -565,9 +563,11 @@ protected: #endif // !Q_OS_WINRT }; -#ifndef QT_NO_PROCESS void tst_QTcpServer::addressReusable() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else #ifdef Q_OS_LINUX QSKIP("The addressReusable test is unstable on Linux. See QTBUG-39985."); #endif @@ -616,8 +616,8 @@ void tst_QTcpServer::addressReusable() QTcpServer server; QVERIFY(server.listen(QHostAddress::LocalHost, 49199)); -} #endif +} void tst_QTcpServer::setNewSocketDescriptorBlocking() { diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 6e04cd9d0e..8de9987ed1 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -95,10 +95,8 @@ private slots: void writeDatagramToNonExistingPeer(); void writeToNonExistingPeer_data(); void writeToNonExistingPeer(); -#ifndef QT_NO_PROCESS void outOfProcessConnectedClientServerTest(); void outOfProcessUnconnectedClientServerTest(); -#endif void zeroLengthDatagram(); void multicastTtlOption_data(); void multicastTtlOption(); @@ -937,9 +935,11 @@ void tst_QUdpSocket::writeToNonExistingPeer() QCOMPARE(int(sConnected.state()), int(QUdpSocket::ConnectedState)); } -#ifndef QT_NO_PROCESS void tst_QUdpSocket::outOfProcessConnectedClientServerTest() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else #if defined(Q_OS_WINCE) QSKIP("This test depends on reading data from QProcess (not supported on Qt/WinCE)."); #endif @@ -996,12 +996,14 @@ void tst_QUdpSocket::outOfProcessConnectedClientServerTest() QVERIFY(clientProcess.waitForFinished()); serverProcess.kill(); QVERIFY(serverProcess.waitForFinished()); -} #endif +} -#ifndef QT_NO_PROCESS void tst_QUdpSocket::outOfProcessUnconnectedClientServerTest() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else #if defined(Q_OS_WINCE) QSKIP("This test depends on reading data from QProcess (not supported on Qt/WinCE)."); #endif @@ -1059,8 +1061,8 @@ void tst_QUdpSocket::outOfProcessUnconnectedClientServerTest() QVERIFY(clientProcess.waitForFinished()); serverProcess.kill(); QVERIFY(serverProcess.waitForFinished()); -} #endif +} void tst_QUdpSocket::zeroLengthDatagram() { |