Commit c85afb5a authored by Milian Wolff's avatar Milian Wolff
Browse files

Open some document in bench_quickopen to make this more real-worldy

parent 6db6e096
......@@ -22,6 +22,8 @@
#include <interfaces/icore.h>
#include <interfaces/iprojectcontroller.h>
#include <interfaces/idocumentcontroller.h>
#include <interfaces/iproject.h>
#include <QIcon>
#include <QTest>
......@@ -30,8 +32,17 @@ QTEST_MAIN(BenchQuickOpen)
using namespace KDevelop;
namespace
{
void openAnyDocument(IProject* project)
{
const auto url = project->fileSet().begin()->toUrl();
QVERIFY(ICore::self()->documentController()->openDocument(url));
}
}
BenchQuickOpen::BenchQuickOpen(QObject* parent)
: QuickOpenTestBase(Core::NoUi, parent)
: QuickOpenTestBase(Core::Default, parent)
{
}
......@@ -88,6 +99,8 @@ void BenchQuickOpen::benchProjectFileFilter_addRemoveProjects()
QScopedPointer<TestProject> projectB(getProjectWithFiles(files, Path(dir.filePath("b_project_dir/"))));
QScopedPointer<TestProject> projectC(getProjectWithFiles(files, Path(dir.filePath("c_project_dir/"))));
openAnyDocument(projectA.data());
QBENCHMARK {
projectController->addProject(projectA.data());
projectController->addProject(projectB.data());
......@@ -114,6 +127,8 @@ void BenchQuickOpen::benchProjectFileFilter_reset()
provider.setFilterText(filter);
projectController->addProject(project);
openAnyDocument(project);
QBENCHMARK {
provider.reset();
}
......
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