diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-05-04 13:15:49 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-05-12 08:28:06 +0000 |
commit | f3c87d21271aa44dd9983093ebc5904f666c4fd7 (patch) | |
tree | c6dbf8c33edbe20924c30099cd0cab5214ce679f | |
parent | bae65d8ddb8d7b54bf5761dbd7133d3b0f65adc3 (diff) |
Fix benchmark: remove benchmarks containing old v8 references
The removed benchmarks don't make sense anymore: they were testing the
QQmlEngine part, while another test was doing the QJSEngine. These days
the QQmlEngine is a subclass of the QJSEngine and the test would call
the QJSEngine (which, as said, was already done in another benchmark).
Change-Id: Id1982dc118c399938a2dca8fb3c0a733e52fb20e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 9abcbbd3ab68da3cf7ee977c82b860e2ac42bb2c)
-rw-r--r-- | tests/benchmarks/qml/qml.pro | 2 | ||||
-rw-r--r-- | tests/benchmarks/qml/script/tst_script.cpp | 89 |
2 files changed, 2 insertions, 89 deletions
diff --git a/tests/benchmarks/qml/qml.pro b/tests/benchmarks/qml/qml.pro index 2cf2dff413..e0d0f9f695 100644 --- a/tests/benchmarks/qml/qml.pro +++ b/tests/benchmarks/qml/qml.pro @@ -9,7 +9,7 @@ SUBDIRS += \ qqmlcomponent \ qqmlmetaproperty \ librarymetrics_performance \ -# script \ ### FIXME: doesn't build + script \ js \ creation diff --git a/tests/benchmarks/qml/script/tst_script.cpp b/tests/benchmarks/qml/script/tst_script.cpp index 77763abed5..054861f852 100644 --- a/tests/benchmarks/qml/script/tst_script.cpp +++ b/tests/benchmarks/qml/script/tst_script.cpp @@ -57,10 +57,8 @@ private slots: void property_getter_qmetaproperty(); #endif void property_qobject(); - void property_qmlobject(); void setproperty_js(); - void setproperty_qmlobject(); void function_js(); #if 0 @@ -68,7 +66,6 @@ private slots: void function_cpp(); #endif void function_qobject(); - void function_qmlobject(); void function_args_js(); #if 0 @@ -76,7 +73,6 @@ private slots: void function_args_cpp(); #endif void function_args_qobject(); - void function_args_qmlobject(); void signal_unconnected(); void signal_qml(); @@ -183,7 +179,7 @@ void tst_script::property_js() } } -#if 0 +#if 0 // This requires internal API access in V4 static QJSValue property_getter_method(QScriptContext *, QJSEngine *engine) { static int x = 0; @@ -310,26 +306,6 @@ void tst_script::property_qobject() } } -void tst_script::property_qmlobject() -{ - QQmlEngine qmlengine; - - TestObject to; - QV8Engine *engine = QQmlEnginePrivate::getV8Engine(&qmlengine); - v8::HandleScope handle_scope; - v8::Context::Scope scope(engine->context()); - QJSValue v = engine->scriptValueFromInternal(engine->qobjectWrapper()->newQObject(&to)); - - QJSValueList args; - args << v; - QJSValue prog = qmlengine.evaluate(PROPERTY_PROGRAM).call(args); - prog.call(); - - QBENCHMARK { - prog.call(); - } -} - #define SETPROPERTY_PROGRAM \ "(function(testObject) { return (function() { " \ " for (var ii = 0; ii < 10000; ++ii) { " \ @@ -354,27 +330,6 @@ void tst_script::setproperty_js() } } -void tst_script::setproperty_qmlobject() -{ - QQmlEngine qmlengine; - - TestObject to; - - QV8Engine *engine = QQmlEnginePrivate::getV8Engine(&qmlengine); - v8::HandleScope handle_scope; - v8::Context::Scope scope(engine->context()); - QJSValue v = engine->scriptValueFromInternal(engine->qobjectWrapper()->newQObject(&to)); - - QJSValueList args; - args << v; - QJSValue prog = qmlengine.evaluate(SETPROPERTY_PROGRAM).call(args); - prog.call(); - - QBENCHMARK { - prog.call(); - } -} - #define FUNCTION_PROGRAM \ "(function(testObject) { return (function() { " \ " var test = 0; " \ @@ -442,27 +397,6 @@ void tst_script::function_qobject() } } -void tst_script::function_qmlobject() -{ - QQmlEngine qmlengine; - - TestObject to; - - QV8Engine *engine = QQmlEnginePrivate::getV8Engine(&qmlengine); - v8::HandleScope handle_scope; - v8::Context::Scope scope(engine->context()); - QJSValue v = engine->scriptValueFromInternal(engine->qobjectWrapper()->newQObject(&to)); - - QJSValueList args; - args << v; - QJSValue prog = qmlengine.evaluate(FUNCTION_PROGRAM).call(args); - prog.call(); - - QBENCHMARK { - prog.call(); - } -} - #define FUNCTION_ARGS_PROGRAM \ "(function(testObject) { return (function() { " \ " var test = 0; " \ @@ -530,27 +464,6 @@ void tst_script::function_args_qobject() } } -void tst_script::function_args_qmlobject() -{ - QQmlEngine qmlengine; - - TestObject to; - - QV8Engine *engine = QQmlEnginePrivate::getV8Engine(&qmlengine); - v8::HandleScope handle_scope; - v8::Context::Scope scope(engine->context()); - QJSValue v = engine->scriptValueFromInternal(engine->qobjectWrapper()->newQObject(&to)); - - QJSValueList args; - args << v; - QJSValue prog = qmlengine.evaluate(FUNCTION_ARGS_PROGRAM).call(args); - prog.call(); - - QBENCHMARK { - prog.call(); - } -} - void tst_script::signal_unconnected() { QQmlEngine engine; |