Commit 50327ae7 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

kns: Use ksplash.knsrc for the test

And if it's not available, just skip the test.


(cherry picked from commit 65664178)
parent b9176005
......@@ -8,4 +8,3 @@ add_library(kns-backend MODULE
target_link_libraries(kns-backend Discover::Common KF5::ConfigCore KF5::Attica KF5::NewStuffCore KF5::WidgetsAddons Qt::Xml)
install(TARGETS kns-backend DESTINATION ${KDE_INSTALL_PLUGINDIR}/discover)
install(FILES custom/discover_ktexteditor_codesnippets_core.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR})
[KNewStuff3]
ProvidersUrl=https://autoconfig.kde.org/ocs/providers.xml
Categories=KTextEditor Snippet
UploadCategories=KTextEditor Snippet
TargetDir=/ktexteditor_snippets/ghns
CustomName=true
Extends=org.kde.kate.desktop
......@@ -23,6 +23,8 @@
QTEST_MAIN(KNSBackendTest)
static QString s_knsrcName = QStringLiteral("ksplash.knsrc");
KNSBackendTest::KNSBackendTest(QObject *parent)
: QObject(parent)
, m_r(nullptr)
......@@ -33,11 +35,11 @@ KNSBackendTest::KNSBackendTest(QObject *parent)
ResourcesModel *model = new ResourcesModel(QStringLiteral("kns-backend"), this);
Q_ASSERT(!model->backends().isEmpty());
auto findTestBackend = [](AbstractResourcesBackend *backend) {
return backend->name() == QLatin1String("discover_ktexteditor_codesnippets_core.knsrc");
return backend->name() == QLatin1String("ksplash.knsrc");
};
m_backend = kFilter<QVector<AbstractResourcesBackend *>>(model->backends(), findTestBackend).at(0);
m_backend = kFilter<QVector<AbstractResourcesBackend *>>(model->backends(), findTestBackend).value(0);
if (!m_backend->isValid()) {
if (!m_backend || !m_backend->isValid()) {
qWarning() << "couldn't run the test";
exit(0);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment