aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-05-04 13:15:49 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2017-05-08 07:49:28 +0000
commit9abcbbd3ab68da3cf7ee977c82b860e2ac42bb2c (patch)
tree318fbd6ead7b9c6b9d9d3be8138b7712789e8891 /tests/benchmarks
parent799f4a526375701d2b68d2ca1c85648994468394 (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>
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/qml/qml.pro2
-rw-r--r--tests/benchmarks/qml/script/tst_script.cpp89
2 files changed, 2 insertions, 89 deletions
diff --git a/tests/benchmarks/qml/qml.pro b/tests/benchmarks/qml/qml.pro
index f1fe87e532..437d13c87e 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 3829f3df6a..a48d6bdec7 100644
--- a/tests/benchmarks/qml/script/tst_script.cpp
+++ b/tests/benchmarks/qml/script/tst_script.cpp
@@ -52,10 +52,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
@@ -63,7 +61,6 @@ private slots:
void function_cpp();
#endif
void function_qobject();
- void function_qmlobject();
void function_args_js();
#if 0
@@ -71,7 +68,6 @@ private slots:
void function_args_cpp();
#endif
void function_args_qobject();
- void function_args_qmlobject();
void signal_unconnected();
void signal_qml();
@@ -178,7 +174,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;
@@ -305,26 +301,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) { " \
@@ -349,27 +325,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; " \
@@ -437,27 +392,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; " \
@@ -525,27 +459,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;