diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-10-23 13:14:41 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-10-23 13:14:41 (GMT) |
commit | 6cd67bb07271950cca86dcad764b8581da588a51 (patch) | |
tree | cef2d24b5e6ea1f5ca6a158f3e4c38aec09269e2 /tests/benchmarks | |
parent | 4ff3e1ca7ce8afab49e5c52a1ae0141abfc8a841 (diff) | |
download | Qt-6cd67bb07271950cca86dcad764b8581da588a51.zip Qt-6cd67bb07271950cca86dcad764b8581da588a51.tar.gz Qt-6cd67bb07271950cca86dcad764b8581da588a51.tar.bz2 |
add benchmark for QScriptEngine::evaluate(QScriptProgram)
Diffstat (limited to 'tests/benchmarks')
-rw-r--r-- | tests/benchmarks/qscriptengine/tst_qscriptengine.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/benchmarks/qscriptengine/tst_qscriptengine.cpp b/tests/benchmarks/qscriptengine/tst_qscriptengine.cpp index 4f011c4..8d5f6e6 100644 --- a/tests/benchmarks/qscriptengine/tst_qscriptengine.cpp +++ b/tests/benchmarks/qscriptengine/tst_qscriptengine.cpp @@ -60,6 +60,8 @@ private slots: void constructor(); void evaluate_data(); void evaluate(); + void evaluateProgram_data(); + void evaluateProgram(); void connectAndDisconnect(); void newObject(); void newQObject(); @@ -153,6 +155,22 @@ void tst_QScriptEngine::connectAndDisconnect() } } +void tst_QScriptEngine::evaluateProgram_data() +{ + evaluate_data(); +} + +void tst_QScriptEngine::evaluateProgram() +{ + QFETCH(QString, code); + QScriptEngine engine; + QScriptProgram program(code); + + QBENCHMARK { + (void)engine.evaluate(program); + } +} + void tst_QScriptEngine::newObject() { QScriptEngine engine; @@ -241,6 +259,5 @@ void tst_QScriptEngine::nativeCall() } } - QTEST_MAIN(tst_QScriptEngine) #include "tst_qscriptengine.moc" |