summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/socket/qtcpserver
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2012-02-13 16:45:13 +0200
committerQt by Nokia <qt-info@nokia.com>2012-02-15 02:34:38 +0100
commit78a6447e311e55320ab3acd5f1035f3c295bf5f8 (patch)
tree938b06db237973f350c36c93ee4f79713412d402 /tests/auto/network/socket/qtcpserver
parent960f246ffc37141101952757bc0234183a6163a9 (diff)
Windows: Fixed helper process finding in network tests
Helper processes were not found properly on all network tests when the test was run with "nmake check": - tst_qtcpsocket - tst_qtcpserver - tst_qnetworksession - tst_qnetworkreply Task-number: QTBUG-24199 Task-number: QTBUG-24203 Task-number: QTBUG-24226 Task-number: QTBUG-24231 Task-number: QTBUG-24232 Change-Id: Ia4451b5a5e3fe9f81aba3837baf8292411f995d8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
Diffstat (limited to 'tests/auto/network/socket/qtcpserver')
-rw-r--r--tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp
index 941e0b2142..ac27a621bb 100644
--- a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp
+++ b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp
@@ -119,6 +119,7 @@ private:
#ifndef QT_NO_BEARERMANAGEMENT
QNetworkSession *networkSession;
#endif
+ QString crashingServerDir;
};
// Testing get/set functions
@@ -150,6 +151,10 @@ void tst_QTcpServer::initTestCase_data()
QTest::newRow("WithoutProxy") << false << 0;
QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy);
+
+ crashingServerDir = QFINDTESTDATA("crashingServer");
+ QVERIFY2(!crashingServerDir.isEmpty(), qPrintable(
+ QString::fromLatin1("Couldn't find crashingServer dir starting from %1.").arg(QDir::currentPath())));
}
void tst_QTcpServer::initTestCase()
@@ -538,7 +543,10 @@ void tst_QTcpServer::addressReusable()
QFile::remove(signalName);
// The crashingServer process will crash once it gets a connection.
QProcess process;
- process.start("crashingServer/crashingServer");
+ QString processExe = crashingServerDir + "/crashingServer";
+ process.start(processExe);
+ QVERIFY2(process.waitForStarted(), qPrintable(
+ QString::fromLatin1("Could not start %1: %2").arg(processExe, process.errorString())));
int waitCount = 5;
while (waitCount-- && !QFile::exists(signalName))
QTest::qWait(1000);
@@ -547,7 +555,10 @@ void tst_QTcpServer::addressReusable()
#else
// The crashingServer process will crash once it gets a connection.
QProcess process;
- process.start("crashingServer/crashingServer");
+ QString processExe = crashingServerDir + "/crashingServer";
+ process.start(processExe);
+ QVERIFY2(process.waitForStarted(), qPrintable(
+ QString::fromLatin1("Could not start %1: %2").arg(processExe, process.errorString())));
QVERIFY(process.waitForReadyRead(5000));
#endif