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 <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2024-02-27 17:19:56 +01:00
parent f3a53dfd8c
commit 68dab97bc5

View File

@@ -494,8 +494,10 @@ void FollowSymbolTest::initTestCase()
return; return;
// Find suitable kit. // 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) { 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) if (!F2TestCase::m_testKit)
QSKIP("This test requires at least one kit to be present"); QSKIP("This test requires at least one kit to be present");