Index: kdevplatform/project/tests/abstractfilemanagerpluginimportbenchmark.cpp =================================================================== --- kdevplatform/project/tests/abstractfilemanagerpluginimportbenchmark.cpp +++ kdevplatform/project/tests/abstractfilemanagerpluginimportbenchmark.cpp @@ -17,19 +17,24 @@ Boston, MA 02110-1301, USA. */ +#include +#include +#include + #include #include #include #include #include +#include #include #include #include -#include +#include #include #include #include @@ -46,9 +51,10 @@ Q_OBJECT public: AbstractFileManagerPluginImportBenchmark(AbstractFileManagerPlugin* manager, const QString& path, - QObject* parent) - : QObject(parent) + TestCore* core) + : QObject(core) , m_out(stdout) + , m_core(core) { m_manager = manager; m_project = new TestProject(Path(path)); @@ -58,6 +64,8 @@ { m_projectNumber = s_numBenchmarksRunning++; m_out << "Starting import of project " << m_project->path().toLocalFile() << endl; + // emulate the signal from the ProjectController to the ProjectFilterProvider(s): + emit m_core->projectController()->projectAboutToBeOpened(m_project); m_timer.start(); auto root = m_manager->import(m_project); int elapsed = m_timer.elapsed(); @@ -75,6 +83,7 @@ QElapsedTimer m_timer; int m_projectNumber; QTextStream m_out; + TestCore* m_core; static int s_numBenchmarksRunning; @@ -86,8 +95,9 @@ { Q_UNUSED(job); int elapsed = m_timer.elapsed(); - m_out << "importing project " << m_projectNumber << " took " - << elapsed / 1000.0 << " seconds" << endl; + m_out << "importing " << m_project->fileSet().size() + << " items into project #" << m_projectNumber + << " took " << elapsed / 1000.0 << " seconds" << endl; s_numBenchmarksRunning -= 1; if (s_numBenchmarksRunning <= 0) { @@ -106,7 +116,7 @@ qWarning() << "Usage:" << argv[0] << "projectDir1 [...projectDirN]"; return 1; } - QCoreApplication app(argc, argv); + QApplication app(argc, argv); QTextStream qout(stdout); // measure the total test time, this provides an indication // of overhead and how well multiple projects are imported in parallel @@ -117,7 +127,11 @@ QElapsedTimer runTimer; AutoTestShell::init({"no plugins"}); - auto core = TestCore::initialize(Core::NoUi); + auto core = TestCore::initialize(); + // attempt to load the "Project Filter" plugin; + if (core->pluginController()->allPluginsForExtension(QStringLiteral("org.kdevelop.IProjectFilter")).size() < 1) { + qWarning() << "The project filter plugin was not loaded"; + } auto manager = new AbstractFileManagerPlugin({}, core); const char *kdwMethod[] = {"FAM", "Inotify", "Stat", "QFSWatch"};