| 66 | } |
| 67 | |
| 68 | void TestOutputModel::bench() |
| 69 | { |
| 70 | QFETCH(KDevelop::OutputModel::OutputFilterStrategy, strategy); |
| 71 | QFETCH(QStringList, lines); |
| 72 | |
| 73 | OutputModel testee(QUrl::fromLocalFile(QStringLiteral("/tmp/build-foo"))); |
| 74 | testee.setFilteringStrategy(strategy); |
| 75 | |
| 76 | quint64 processEventsCounter = 1; |
| 77 | QElapsedTimer totalTime; |
| 78 | totalTime.start(); |
| 79 | |
| 80 | testee.appendLines(lines); |
| 81 | while(testee.rowCount() != lines.count()) { |
| 82 | QCoreApplication::instance()->processEvents(); |
| 83 | processEventsCounter++; |
| 84 | } |
| 85 | |
| 86 | QVERIFY(testee.rowCount() == lines.count()); |
| 87 | const qint64 elapsed = totalTime.elapsed(); |
| 88 | |
| 89 | qDebug() << "ms elapsed to add lines: " << elapsed; |
| 90 | qDebug() << "total number of added lines: " << lines.count(); |
| 91 | const double avgUiLockup = double(elapsed) / processEventsCounter; |
| 92 | qDebug() << "average UI lockup in ms: " << avgUiLockup; |
| 93 | QVERIFY(avgUiLockup < 200); |
| 94 | } |
| 95 | |
| 96 | void TestOutputModel::bench_data() |
| 97 | { |
nothing calls this directly
no test coverage detected