File indexing completed on 2022-10-04 14:00:19

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2008 Patrick Spendrin <ps_ml@gmx.de>
0004 //
0005 
0006 
0007 #include "MarbleDirs.h"
0008 #include "PluginManager.h"
0009 
0010 #include <QTest>
0011 
0012 namespace Marble
0013 {
0014 
0015 class PluginManagerTest : public QObject
0016 {
0017     Q_OBJECT
0018     private Q_SLOTS:
0019         void loadPlugins();
0020 };
0021 
0022 void PluginManagerTest::loadPlugins()
0023 {
0024     MarbleDirs::setMarbleDataPath( DATA_PATH );
0025     MarbleDirs::setMarblePluginPath( PLUGIN_PATH );
0026 
0027     const int pluginNumber = MarbleDirs::pluginEntryList( "", QDir::Files ).size();
0028 
0029     PluginManager pm;
0030     const int renderPlugins = pm.renderPlugins().size();
0031     const int positionPlugins = pm.positionProviderPlugins().size();
0032     const int searchRunnerPlugins = pm.searchRunnerPlugins().size();
0033     const int reverseGeocodingRunnerPlugins = pm.reverseGeocodingRunnerPlugins().size();
0034     const int routingRunnerPlugins = pm.routingRunnerPlugins().size();
0035     const int parsingRunnerPlugins = pm.parsingRunnerPlugins().size();
0036 
0037     const int runnerPlugins = searchRunnerPlugins + reverseGeocodingRunnerPlugins + routingRunnerPlugins + parsingRunnerPlugins;
0038 
0039     QCOMPARE( renderPlugins + positionPlugins + runnerPlugins, pluginNumber );
0040 }
0041 
0042 }
0043 
0044 QTEST_MAIN( Marble::PluginManagerTest )
0045 
0046 #include "PluginManagerTest.moc"