| 55 | } |
| 56 | |
| 57 | void LanguageControllerTestBase::initTestCase() |
| 58 | { |
| 59 | AutoTestShell::init({"kdevclangsupport", "kdevpatchreview", "kdevqmljs", |
| 60 | "KDevCMakeManager", "KDevCMakeBuilder", "KDevMakeBuilder", "KDevStandardOutputView"}); |
| 61 | TestCore::initialize(); |
| 62 | m_subject = Core::self()->languageController(); |
| 63 | |
| 64 | // Remove entries for languages supported by unavailable optional plugins. |
| 65 | for (auto it = m_differentLanguagesUrls.cbegin(); it != m_differentLanguagesUrls.cend();) { |
| 66 | const auto mimeType = QMimeDatabase().mimeTypeForFile(it->url.fileName(), QMimeDatabase::MatchExtension); |
| 67 | QVERIFY(mimeType.isValid()); |
| 68 | QVERIFY(!mimeType.isDefault()); |
| 69 | |
| 70 | const QVariantMap constraints{{"X-KDevelop-SupportedMimeTypes", mimeType.name()}}; |
| 71 | const bool languagePluginLoaded = |
| 72 | !ICore::self()->pluginController()->queryExtensionPlugins("ILanguageSupport", constraints).empty(); |
| 73 | if (languagePluginLoaded) { |
| 74 | ++it; |
| 75 | } else { |
| 76 | qWarning() << "expected language plugin" << it->languageName << "for MIME type" << mimeType.name() |
| 77 | << "has not been loaded => skipping test data rows for this language"; |
| 78 | it = m_differentLanguagesUrls.erase(it); |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | if (m_differentLanguagesUrls.empty()) { |
| 83 | QSKIP("zero language plugins => skip the entire test to prevent an assertion failure in QTest::fetchData()"); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | void LanguageControllerTestBase::init() |
| 88 | { |
nothing calls this directly
no test coverage detected