forked from qt-creator/qt-creator
QmlProfiler: Use a predictable kit in the QmlProfilerTool test
We may not have a valid kit at all, and then the test would fail. Change-Id: Ie2613e67309121f0df847e76668bc433fd88c315 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -26,6 +26,9 @@
|
|||||||
#include "qmlprofilertool_test.h"
|
#include "qmlprofilertool_test.h"
|
||||||
#include "fakedebugserver.h"
|
#include "fakedebugserver.h"
|
||||||
|
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
#include <projectexplorer/kit.h>
|
||||||
|
#include <projectexplorer/kitmanager.h>
|
||||||
#include <projectexplorer/runconfiguration.h>
|
#include <projectexplorer/runconfiguration.h>
|
||||||
#include <qmlprofiler/qmlprofilerattachdialog.h>
|
#include <qmlprofiler/qmlprofilerattachdialog.h>
|
||||||
#include <qmlprofiler/qmlprofilerclientmanager.h>
|
#include <qmlprofiler/qmlprofilerclientmanager.h>
|
||||||
@@ -41,6 +44,14 @@ namespace Internal {
|
|||||||
|
|
||||||
void QmlProfilerToolTest::testAttachToWaitingApplication()
|
void QmlProfilerToolTest::testAttachToWaitingApplication()
|
||||||
{
|
{
|
||||||
|
ProjectExplorer::Kit *newKit = new ProjectExplorer::Kit("fookit");
|
||||||
|
ProjectExplorer::KitManager *kitManager = ProjectExplorer::KitManager::instance();
|
||||||
|
QVERIFY(kitManager);
|
||||||
|
QVERIFY(kitManager->registerKit(newKit));
|
||||||
|
QSettings *settings = Core::ICore::settings();
|
||||||
|
QVERIFY(settings);
|
||||||
|
settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/kitId"), newKit->id().toSetting());
|
||||||
|
|
||||||
QmlProfilerTool profilerTool;
|
QmlProfilerTool profilerTool;
|
||||||
QTcpServer server;
|
QTcpServer server;
|
||||||
QUrl serverUrl = Utils::urlFromLocalHostAndFreePort();
|
QUrl serverUrl = Utils::urlFromLocalHostAndFreePort();
|
||||||
|
Reference in New Issue
Block a user