From 41017d1bbd2d4455edb787c65873c8512bc909d5 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 19 Feb 2018 09:49:40 +0100 Subject: [PATCH] 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 --- .../qmlprofiler/tests/qmlprofilertool_test.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp index 5ed54ca4c4b..62cfb0d933e 100644 --- a/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp +++ b/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp @@ -26,6 +26,9 @@ #include "qmlprofilertool_test.h" #include "fakedebugserver.h" +#include +#include +#include #include #include #include @@ -41,6 +44,14 @@ namespace Internal { 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; QTcpServer server; QUrl serverUrl = Utils::urlFromLocalHostAndFreePort();