GUITESTS: Add benchmark for tokenize + simplify.

This commit is contained in:
Kimmo Varis 2011-09-18 09:44:27 +03:00
parent b5d22fda0d
commit 8b5c1ad8b7
2 changed files with 19 additions and 0 deletions

View File

@ -63,4 +63,22 @@ void BenchmarkSimple::simplify()
}
}
void BenchmarkSimple::tokenizeAndSimplify()
{
QFile file(QString(SRCDIR) + "/../../data/benchmark/simple.cpp");
QByteArray data = file.readAll();
Settings settings;
settings.debugwarnings = true;
// tokenize..
Tokenizer tokenizer(&settings, this);
std::istringstream istr(data.constData());
QBENCHMARK
{
tokenizer.tokenize(istr, "test.cpp");
tokenizer.simplifyTokenList();
}
}
QTEST_MAIN(BenchmarkSimple)

View File

@ -27,6 +27,7 @@ class BenchmarkSimple: public QObject, public ErrorLogger
private slots:
void tokenize();
void simplify();
void tokenizeAndSimplify();
private:
// Empty implementations of ErrorLogger methods.