| 109 | } |
| 110 | |
| 111 | void TestPluginEnabling::loadPluginNormalDefaults() |
| 112 | { |
| 113 | QFETCH(QString, pluginId); |
| 114 | QFETCH(bool, shouldBeEnabled); |
| 115 | |
| 116 | AutoTestShell::init(); |
| 117 | // see TODO in loadPluginCustomDefaults() |
| 118 | TestCore::initialize(Core::NoUi, QStringLiteral("test_pluginenabling_normal_")+pluginId); |
| 119 | TestCore::self()->activeSession()->setTemporary(true); |
| 120 | m_pluginCtrl = Core::self()->pluginControllerInternal(); |
| 121 | |
| 122 | // check plugin metadata |
| 123 | const auto pluginInfo = m_pluginCtrl->infoForPluginId(pluginId); |
| 124 | // logic in kdevelop different from KPluginMetaData::isEnabledByDefault(), here defaults to true |
| 125 | const QJsonValue enabledByDefaultValue = pluginInfo.rawData()["KPlugin"].toObject()["EnabledByDefault"]; |
| 126 | const bool enabledByDefault = (enabledByDefaultValue.isNull() || enabledByDefaultValue.toBool()); |
| 127 | QCOMPARE(enabledByDefault, shouldBeEnabled); |
| 128 | |
| 129 | loadPlugin(pluginId, shouldBeEnabled); |
| 130 | |
| 131 | TestCore::shutdown(); |
| 132 | } |
| 133 | |
| 134 | QTEST_MAIN(TestPluginEnabling) |
| 135 |
nothing calls this directly
no test coverage detected