QmlDebugging: Auto tests use port range
authorAurindam Jana <aurindam.jana@digia.com>
Mon, 15 Apr 2013 15:27:24 +0000 (17:27 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 16 Apr 2013 15:05:30 +0000 (17:05 +0200)
Change-Id: I715f50a696283d2a2af0f54409de02289637bf78
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp
tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp
tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp
tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp

index 363efea..e6cbd41 100644 (file)
@@ -48,7 +48,7 @@
 #include <QtCore/QString>
 #include <QtTest/QtTest>
 
-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)
index dd4dd00..1c1d84f 100644 (file)
@@ -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'.");
index 6f99afd..5badcaa 100644 (file)
@@ -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);
 }
index f1fbdd2..e430875 100644 (file)
@@ -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()
index 3a925e2..9982e5d 100644 (file)
@@ -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()