| 64 | } |
| 65 | |
| 66 | void BenchCodeCompletion::benchCodeCompletion() |
| 67 | { |
| 68 | QFETCH(QString, code); |
| 69 | QFETCH(KTextEditor::Cursor, position); |
| 70 | |
| 71 | TestFile file(code, "cpp"); |
| 72 | QVERIFY(file.parseAndWait(TopDUContext::AllDeclarationsContextsUsesAndAST, 1, 5000)); |
| 73 | |
| 74 | auto view = createView(file.url().toUrl()); |
| 75 | |
| 76 | QSignalSpy spy(m_model, &QAbstractItemModel::modelReset); |
| 77 | QBENCHMARK { |
| 78 | m_model->completionInvoked(view.get(), {position, position}, KTextEditor::CodeCompletionModel::UserInvocation); |
| 79 | do { |
| 80 | spy.wait(); |
| 81 | } while (!m_model->rowCount()); |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | #include "moc_bench_codecompletion.cpp" |
nothing calls this directly
no test coverage detected