QmlDebugging: Auto tests use port range
Change-Id: I715f50a696283d2a2af0f54409de02289637bf78 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
parent
b90699ac82
commit
4b1cab6968
|
@ -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)
|
||||
|
|
|
@ -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'.");
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue