diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-08-05 17:27:08 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-08-13 08:30:47 +0000 |
commit | fbdc01f141a4ec4e6fc78ea69d86ff7aa128bf72 (patch) | |
tree | 4529687ecc253a463abdd568f717143ec966dbb0 /tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest | |
parent | fc3403502fed19e0b8ab5a85b0c3aa2587e22475 (diff) |
Allow specification of loadable debug services via command line
We don't want to load the debugger when profiling and vice versa. This
makes it easier to prevent unwanted services from getting loaded.
Task-number: QTBUG-47623
Change-Id: I28893b6218110274a6d30b27805d89dbb443add3
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest')
-rw-r--r-- | tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp index 8d119a30d7..0285bae189 100644 --- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp +++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp @@ -61,6 +61,7 @@ public: private: + void init(bool restrictServices); QmlDebugObjectReference findRootObject(); QQmlDebugProcess *m_process; @@ -68,9 +69,9 @@ private: QQmlEngineDebugClient *m_engineDebugClient; private slots: - void init(); void cleanup(); + void connect_data(); void connect(); void clearObjectReferenceHashonReloadQml(); }; @@ -93,9 +94,12 @@ QmlDebugObjectReference tst_QQmlEngineDebugInspectorIntegration::findRootObject( } -void tst_QQmlEngineDebugInspectorIntegration::init() +void tst_QQmlEngineDebugInspectorIntegration::init(bool restrictServices) { - const QString argument = "-qmljsdebugger=port:" STR_PORT_FROM "," STR_PORT_TO ",block"; + const QString argument = QString::fromLatin1("-qmljsdebugger=port:%1,%2,block%3") + .arg(STR_PORT_FROM).arg(STR_PORT_TO) + .arg(restrictServices ? QStringLiteral(",services:QmlDebugger,QmlInspector") : + QString()); // ### Still using qmlscene because of QTBUG-33376 m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) @@ -108,10 +112,8 @@ void tst_QQmlEngineDebugInspectorIntegration::init() m_inspectorClient = new QQmlInspectorClient(m_connection); m_engineDebugClient = new QQmlEngineDebugClient(m_connection); - const int port = m_process->debugPort(); - m_connection->connectToHost(QLatin1String("127.0.0.1"), port); - bool ok = m_connection->waitForConnected(); - QVERIFY(ok); + m_connection->connectToHost(QLatin1String("127.0.0.1"), m_process->debugPort()); + QVERIFY(m_connection->waitForConnected()); } void tst_QQmlEngineDebugInspectorIntegration::cleanup() @@ -125,14 +127,24 @@ void tst_QQmlEngineDebugInspectorIntegration::cleanup() delete m_inspectorClient; } +void tst_QQmlEngineDebugInspectorIntegration::connect_data() +{ + QTest::addColumn<bool>("restrictMode"); + QTest::newRow("unrestricted") << false; + QTest::newRow("restricted") << true; +} + void tst_QQmlEngineDebugInspectorIntegration::connect() { + QFETCH(bool, restrictMode); + init(restrictMode); QTRY_COMPARE(m_inspectorClient->state(), QQmlDebugClient::Enabled); QTRY_COMPARE(m_engineDebugClient->state(), QQmlDebugClient::Enabled); } void tst_QQmlEngineDebugInspectorIntegration::clearObjectReferenceHashonReloadQml() { + init(true); QTRY_COMPARE(m_engineDebugClient->state(), QQmlDebugClient::Enabled); bool success = false; QmlDebugObjectReference rootObject = findRootObject(); |