GUITESTS: Add benchmark for tokenize + simplify.
This commit is contained in:
parent
b5d22fda0d
commit
8b5c1ad8b7
|
@ -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)
|
||||
|
|
|
@ -27,6 +27,7 @@ class BenchmarkSimple: public QObject, public ErrorLogger
|
|||
private slots:
|
||||
void tokenize();
|
||||
void simplify();
|
||||
void tokenizeAndSimplify();
|
||||
|
||||
private:
|
||||
// Empty implementations of ErrorLogger methods.
|
||||
|
|
Loading…
Reference in New Issue