From 68dab97bc567a2236e943653680ba7b29ec25945 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 27 Feb 2024 17:19:56 +0100 Subject: [PATCH] CppEditor: Fix running tests with clangd Try harder to find a suitable kit: - Pick one without warnings. - Pick one with a Qt, as otherwise configureAsExampleProject() will fail. Change-Id: I5a38e86bd81840c6794de365980618c904936d3a Reviewed-by: Christian Stenger --- .../cppeditor/followsymbol_switchmethoddecldef_test.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp index d18e8dc391c..6597a261c47 100644 --- a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp +++ b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp @@ -494,8 +494,10 @@ void FollowSymbolTest::initTestCase() return; // Find suitable kit. + // Qt is not actually required for the tests, but we need it for consistency with + // configureAsExampleProject(). F2TestCase::m_testKit = Utils::findOr(KitManager::kits(), nullptr, [](const Kit *k) { - return k->isValid(); + return k->isValid() && !k->hasWarning() && k->value("QtSupport.QtInformation").isValid(); }); if (!F2TestCase::m_testKit) QSKIP("This test requires at least one kit to be present");