From kde-commits Wed Dec 31 22:35:39 2014 From: David Faure Date: Wed, 31 Dec 2014 22:35:39 +0000 To: kde-commits Subject: [kservice] autotests: Fix test on CI where not all servicetypes are available. Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=142006535008403 Git commit 05d316940da23efb2b8e80f70cdb76bc324780b2 by David Faure. Committed on 31/12/2014 at 22:34. Pushed by dfaure into branch 'master'. Fix test on CI where not all servicetypes are available. M +11 -9 autotests/ksycocadicttest.cpp http://commits.kde.org/kservice/05d316940da23efb2b8e80f70cdb76bc324780b2 diff --git a/autotests/ksycocadicttest.cpp b/autotests/ksycocadicttest.cpp index 2808376..d5e59d1 100644 --- a/autotests/ksycocadicttest.cpp +++ b/autotests/ksycocadicttest.cpp @@ -77,21 +77,23 @@ void KSycocaDictTest::testStandardDict() runKBuildSycoca(); } = - if (!KServiceType::serviceType("KCModule")) { - QSKIP("Missing servicetypes"); - } - QStringList serviceTypes; serviceTypes << "KUriFilter/Plugin" << "KDataTool" << "KCModule" << "KScan/KScanDialog" - << "Browser/View"; - - if (KServiceType::serviceType("Plasma/Applet")) { - serviceTypes << "Plasma/Applet" - << "Plasma/Runner"; + << "Browser/View" + << "Plasma/Applet" + << "Plasma/Runner"; + + // Skip servicetypes that are not installed + QMutableListIterator it(serviceTypes); + while (it.hasNext()) { + if (!KServiceType::serviceType(it.next())) { + it.remove(); + } } + //qDebug() << serviceTypes; = QBENCHMARK { QByteArray buffer;