Changeset View
Changeset View
Standalone View
Standalone View
autotests/highlighter_benchmark.cpp
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Line(s) | 85 | private Q_SLOTS: | |||
---|---|---|---|---|---|
93 | } | 93 | } | ||
94 | 94 | | |||
95 | void benchmarkHighlight_data() | 95 | void benchmarkHighlight_data() | ||
96 | { | 96 | { | ||
97 | QTest::addColumn<QString>("inFile"); | 97 | QTest::addColumn<QString>("inFile"); | ||
98 | QTest::addColumn<QString>("syntax"); | 98 | QTest::addColumn<QString>("syntax"); | ||
99 | 99 | | |||
100 | const QDir dir(QStringLiteral(TESTSRCDIR "/input")); | 100 | const QDir dir(QStringLiteral(TESTSRCDIR "/input")); | ||
101 | foreach (const auto &fileName, dir.entryList(QDir::Files | QDir::NoSymLinks | QDir::Readable, QDir::Name)) { | 101 | for (const auto &fileName : dir.entryList(QDir::Files | QDir::NoSymLinks | QDir::Readable, QDir::Name)) { | ||
102 | const auto inFile = dir.absoluteFilePath(fileName); | 102 | const auto inFile = dir.absoluteFilePath(fileName); | ||
103 | if (inFile.endsWith(QLatin1String(".syntax"))) | 103 | if (inFile.endsWith(QLatin1String(".syntax"))) | ||
104 | continue; | 104 | continue; | ||
105 | 105 | | |||
106 | QString syntax; | 106 | QString syntax; | ||
107 | QFile syntaxOverride(inFile + QStringLiteral(".syntax")); | 107 | QFile syntaxOverride(inFile + QStringLiteral(".syntax")); | ||
108 | if (syntaxOverride.exists() && syntaxOverride.open(QFile::ReadOnly)) | 108 | if (syntaxOverride.exists() && syntaxOverride.open(QFile::ReadOnly)) | ||
109 | syntax = QString::fromUtf8(syntaxOverride.readAll()).trimmed(); | 109 | syntax = QString::fromUtf8(syntaxOverride.readAll()).trimmed(); | ||
Show All 36 Lines |