From 4b1cab696842572ff333ef1f17d2fa2a2fc31831 Mon Sep 17 00:00:00 2001 From: Aurindam Jana Date: Mon, 15 Apr 2013 17:27:24 +0200 Subject: [PATCH] QmlDebugging: Auto tests use port range Change-Id: I715f50a696283d2a2af0f54409de02289637bf78 Reviewed-by: Kai Koehne --- .../qdebugmessageservice/tst_qdebugmessageservice.cpp | 5 +++-- .../qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp | 4 ++-- .../tst_qqmlenginedebuginspectorintegration.cpp | 9 +++++---- tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp | 9 +++++---- .../debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp | 11 ++++++----- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp index 363efea..e6cbd41 100644 --- a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp +++ b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp @@ -48,7 +48,7 @@ #include #include -const char *NORMALMODE = "-qmljsdebugger=port:3777,block"; +const char *NORMALMODE = "-qmljsdebugger=port:3777,3787,block"; const char *QMLFILE = "test.qml"; class QQmlDebugMsgClient; @@ -186,7 +186,8 @@ void tst_QDebugMessageService::init() QVERIFY2(m_process->waitForSessionStart(), "Could not launch application, or did not get 'Waiting for connection'."); - m_connection->connectToHost("127.0.0.1", 3777); + const int port = m_process->debugPort(); + m_connection->connectToHost("127.0.0.1", port); QVERIFY(m_connection->waitForConnected()); if (m_client->state() != QQmlDebugClient::Enabled) diff --git a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp index dd4dd00..1c1d84f 100644 --- a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp +++ b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp @@ -104,7 +104,7 @@ void tst_QQmlDebugService::checkPortRange() QQmlDebugConnection *connection1 = new QQmlDebugConnection(); QQmlDebugProcess *process1 = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); - process1->start(QStringList() << QLatin1String("-qmljsdebugger=port:3772, 3774 ") << testFile("test.qml")); + process1->start(QStringList() << QLatin1String("-qmljsdebugger=port:3782,3792") << testFile("test.qml")); if (!process1->waitForSessionStart()) QFAIL("could not launch application, or did not get 'Waiting for connection'."); @@ -118,7 +118,7 @@ void tst_QQmlDebugService::checkPortRange() QQmlDebugConnection *connection2 = new QQmlDebugConnection(); QQmlDebugProcess *process2 = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); - process2->start(QStringList() << QLatin1String("-qmljsdebugger=port:3772,3774") << testFile("test.qml")); + process2->start(QStringList() << QLatin1String("-qmljsdebugger=port:3782,3792") << testFile("test.qml")); if (!process2->waitForSessionStart()) QFAIL("could not launch application, or did not get 'Waiting for connection'."); diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp index 6f99afd..5badcaa 100644 --- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp +++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp @@ -52,8 +52,8 @@ #include "qqmlinspectorclient.h" #include "qqmlenginedebugclient.h" -#define PORT 3776 -#define STR_PORT "3776" +#define STR_PORT_FROM "3776" +#define STR_PORT_TO "3786" class tst_QQmlEngineDebugInspectorIntegration : public QQmlDataTest { @@ -105,7 +105,7 @@ QmlDebugObjectReference tst_QQmlEngineDebugInspectorIntegration::findRootObject( void tst_QQmlEngineDebugInspectorIntegration::init() { - const QString argument = "-qmljsdebugger=port:" STR_PORT ",block"; + const QString argument = "-qmljsdebugger=port:" STR_PORT_FROM "," STR_PORT_TO ",block"; m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); @@ -117,7 +117,8 @@ void tst_QQmlEngineDebugInspectorIntegration::init() m_inspectorClient = new QQmlInspectorClient(m_connection); m_engineDebugClient = new QQmlEngineDebugClient(m_connection); - m_connection->connectToHost(QLatin1String("127.0.0.1"), PORT); + const int port = m_process->debugPort(); + m_connection->connectToHost(QLatin1String("127.0.0.1"), port); bool ok = m_connection->waitForConnected(); QVERIFY(ok); } diff --git a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp index f1fbdd2..e430875 100644 --- a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp +++ b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp @@ -50,8 +50,8 @@ #include "../../../shared/util.h" #include "qqmlinspectorclient.h" -#define PORT 3772 -#define STR_PORT "3772" +#define STR_PORT_FROM "3772" +#define STR_PORT_TO "3782" @@ -87,7 +87,7 @@ private slots: void tst_QQmlInspector::startQmlsceneProcess(const char * /* qmlFile */) { - const QString argument = "-qmljsdebugger=port:" STR_PORT ",block"; + const QString argument = "-qmljsdebugger=port:" STR_PORT_FROM "," STR_PORT_TO ",block"; m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); m_process->start(QStringList() << argument << testFile("qtquick2.qml")); @@ -97,7 +97,8 @@ void tst_QQmlInspector::startQmlsceneProcess(const char * /* qmlFile */) QQmlDebugConnection *m_connection = new QQmlDebugConnection(); m_client = new QQmlInspectorClient(m_connection); - m_connection->connectToHost(QLatin1String("127.0.0.1"), PORT); + const int port = m_process->debugPort(); + m_connection->connectToHost(QLatin1String("127.0.0.1"), port); } void tst_QQmlInspector::init() diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index 3a925e2..9982e5d 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -46,8 +46,8 @@ #include "qqmldebugclient.h" #include "../../../shared/util.h" -#define PORT 13773 -#define STR_PORT "13773" +#define STR_PORT_FROM "13773" +#define STR_PORT_TO "13783" struct QQmlProfilerData { @@ -234,9 +234,9 @@ void tst_QQmlProfilerService::connect(bool block, const QString &testFile) QStringList arguments; if (block) - arguments << QString("-qmljsdebugger=port:" STR_PORT ",block"); + arguments << QString("-qmljsdebugger=port:" STR_PORT_FROM "," STR_PORT_TO ",block"); else - arguments << QString("-qmljsdebugger=port:" STR_PORT); + arguments << QString("-qmljsdebugger=port:" STR_PORT_FROM "," STR_PORT_TO ); arguments << QQmlDataTest::instance()->testFile(testFile); @@ -247,7 +247,8 @@ void tst_QQmlProfilerService::connect(bool block, const QString &testFile) QQmlDebugConnection *m_connection = new QQmlDebugConnection(); m_client = new QQmlProfilerClient(m_connection); - m_connection->connectToHost(QLatin1String("127.0.0.1"), PORT); + const int port = m_process->debugPort(); + m_connection->connectToHost(QLatin1String("127.0.0.1"), port); } void tst_QQmlProfilerService::cleanup() -- 2.7.4