aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/qml')
-rw-r--r--tests/benchmarks/qml/animation/animation.pro5
-rw-r--r--tests/benchmarks/qml/compilation/tst_compilation.cpp6
-rw-r--r--tests/benchmarks/qml/creation/creation.pro3
-rw-r--r--tests/benchmarks/qml/creation/tst_creation.cpp8
-rw-r--r--tests/benchmarks/qml/holistic/testtypes.cpp14
-rw-r--r--tests/benchmarks/qml/painting/paintbenchmark.cpp5
-rw-r--r--tests/benchmarks/qml/pointers/pointers.pro2
-rw-r--r--tests/benchmarks/qml/pointers/tst_pointers.cpp2
-rw-r--r--tests/benchmarks/qml/qquickwindow/tst_qquickwindow.cpp4
-rw-r--r--tests/benchmarks/qml/typeimports/tst_typeimports.cpp2
10 files changed, 24 insertions, 27 deletions
diff --git a/tests/benchmarks/qml/animation/animation.pro b/tests/benchmarks/qml/animation/animation.pro
index 58933cf038..e089884a7e 100644
--- a/tests/benchmarks/qml/animation/animation.pro
+++ b/tests/benchmarks/qml/animation/animation.pro
@@ -1,11 +1,10 @@
+CONFIG += testcase
TEMPLATE = app
TARGET = tst_animation
-QT += qml
+QT += qml testlib core-private gui-private qml-private quick-private
macx:CONFIG -= app_bundle
SOURCES += tst_animation.cpp
DEFINES += SRCDIR=\\\"$$PWD\\\"
-
-QT += testlib core-private gui-private qml-private quick-private
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/benchmarks/qml/compilation/tst_compilation.cpp b/tests/benchmarks/qml/compilation/tst_compilation.cpp
index 148396622b..eac3dcc2dd 100644
--- a/tests/benchmarks/qml/compilation/tst_compilation.cpp
+++ b/tests/benchmarks/qml/compilation/tst_compilation.cpp
@@ -120,7 +120,6 @@ void tst_compilation::jsparser()
QBENCHMARK {
QQmlJS::Engine engine;
- QQmlJS::NodePool nodePool(file, &engine);
QQmlJS::Lexer lexer(&engine);
lexer.setCode(code, -1);
@@ -146,11 +145,14 @@ void tst_compilation::scriptparser()
QVERIFY(f.open(QIODevice::ReadOnly));
QByteArray data = f.readAll();
+ //TODO(pvarga): check preparseData
+ QByteArray preparseData;
QUrl url = QUrl::fromLocalFile(file);
+ QString urlString = url.toString();
QBENCHMARK {
QQmlScript::Parser parser;
- parser.parse(data, url);
+ parser.parse(data, preparseData, url, urlString);
parser.tree();
}
}
diff --git a/tests/benchmarks/qml/creation/creation.pro b/tests/benchmarks/qml/creation/creation.pro
index 8d26ef88df..0cfac64d5f 100644
--- a/tests/benchmarks/qml/creation/creation.pro
+++ b/tests/benchmarks/qml/creation/creation.pro
@@ -1,11 +1,10 @@
CONFIG += testcase
TEMPLATE = app
TARGET = tst_creation
+QT += core-private gui-private qml-private quick-private widgets testlib
macx:CONFIG -= app_bundle
SOURCES += tst_creation.cpp
DEFINES += SRCDIR=\\\"$$PWD\\\"
-
-QT += core-private gui-private qml-private qtquick1-private widgets testlib
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/benchmarks/qml/creation/tst_creation.cpp b/tests/benchmarks/qml/creation/tst_creation.cpp
index 4b5c1d1950..b6b402a6c0 100644
--- a/tests/benchmarks/qml/creation/tst_creation.cpp
+++ b/tests/benchmarks/qml/creation/tst_creation.cpp
@@ -48,7 +48,6 @@
#include <QGraphicsItem>
#include <QQuickItem>
#include <QQmlContext>
-#include <QtQuick1/private/qdeclarativetextinput_p.h>
#include <private/qobject_p.h>
class tst_creation : public QObject
@@ -96,7 +95,7 @@ public:
: QObject(parent) {}
QQmlListProperty<QObject> resources() {
- return QQmlListProperty<QObject>(this, 0, resources_append);
+ return QQmlListProperty<QObject>(this, 0, resources_append, 0, 0, 0);
}
static void resources_append(QQmlListProperty<QObject> *p, QObject *o) {
@@ -107,9 +106,6 @@ public:
tst_creation::tst_creation()
{
qmlRegisterType<TestType>("Qt.test", 1, 0, "TestType");
-
- //get rid of initialization effects
- QDeclarative1TextInput te;
}
inline QUrl TEST_FILE(const QString &filename)
@@ -321,9 +317,7 @@ void tst_creation::itemtree_qml()
void tst_creation::itemtree_scene_cpp()
{
- QGraphicsScene scene;
QQuickItem *root = new QQuickItem;
- scene.addItem(root);
QBENCHMARK {
QQuickItem *item = new QQuickItem;
for (int i = 0; i < 30; ++i) {
diff --git a/tests/benchmarks/qml/holistic/testtypes.cpp b/tests/benchmarks/qml/holistic/testtypes.cpp
index 0a9e36dc3a..9b1bb86850 100644
--- a/tests/benchmarks/qml/holistic/testtypes.cpp
+++ b/tests/benchmarks/qml/holistic/testtypes.cpp
@@ -82,13 +82,13 @@ void registerTypes()
qmlRegisterType<ScarceResourceProvider>("Qt.test", 1,0, "MyScarceResourceProvider");
qmlRegisterType<ArbitraryVariantProvider>("Qt.test", 1,0, "MyArbitraryVariantProvider");
- qmlRegisterSingletonType("Qt.test",1,0,script_api); // register (script) singleton Type for an existing uri which contains elements
- qmlRegisterSingletonType<testQObjectApi>("Qt.test",1,0,qobject_api); // register (qobject) for an existing uri for which another singleton Type was previously regd. Should replace!
- qmlRegisterSingletonType("Qt.test.scriptApi",1,0,script_api); // register (script) singleton Type for a uri which doesn't contain elements
- qmlRegisterSingletonType<testQObjectApi>("Qt.test.qobjectApi",1,0,qobject_api); // register (qobject) singleton Type for a uri which doesn't contain elements
- qmlRegisterSingletonType<testQObjectApi>("Qt.test.qobjectApi",1,3,qobject_api); // register (qobject) singleton Type for a uri which doesn't contain elements, minor version set
- qmlRegisterSingletonType<testQObjectApi>("Qt.test.qobjectApi",2,0,qobject_api); // register (qobject) singleton Type for a uri which doesn't contain elements, major version set
- qmlRegisterSingletonType<testQObjectApi>("Qt.test.qobjectApiParented",1,0,qobject_api_engine_parent); // register (parented qobject) singleton Type for a uri which doesn't contain elements
+ qmlRegisterSingletonType("Qt.test",1,0,"Script",script_api); // register (script) singleton Type for an existing uri which contains elements
+ qmlRegisterSingletonType<testQObjectApi>("Qt.test",1,0,"QObject",qobject_api); // register (qobject) for an existing uri for which another singleton Type was previously regd. Should replace!
+ qmlRegisterSingletonType("Qt.test.scriptApi",1,0,"Script",script_api); // register (script) singleton Type for a uri which doesn't contain elements
+ qmlRegisterSingletonType<testQObjectApi>("Qt.test.qobjectApi",1,0,"QObject",qobject_api); // register (qobject) singleton Type for a uri which doesn't contain elements
+ qmlRegisterSingletonType<testQObjectApi>("Qt.test.qobjectApi",1,3,"QObject",qobject_api); // register (qobject) singleton Type for a uri which doesn't contain elements, minor version set
+ qmlRegisterSingletonType<testQObjectApi>("Qt.test.qobjectApi",2,0,"QObject",qobject_api); // register (qobject) singleton Type for a uri which doesn't contain elements, major version set
+ qmlRegisterSingletonType<testQObjectApi>("Qt.test.qobjectApiParented",1,0,"QObject",qobject_api_engine_parent); // register (parented qobject) singleton Type for a uri which doesn't contain elements
}
//#include "testtypes.moc"
diff --git a/tests/benchmarks/qml/painting/paintbenchmark.cpp b/tests/benchmarks/qml/painting/paintbenchmark.cpp
index b99161749d..1fc7813c04 100644
--- a/tests/benchmarks/qml/painting/paintbenchmark.cpp
+++ b/tests/benchmarks/qml/painting/paintbenchmark.cpp
@@ -180,6 +180,8 @@ void paint_RoundedRect(QPainter &p)
}
}
+// Disable this test case since this cannot be compiled with Qt5.
+#if 0
void paint_QPixmapCachedRoundedRect(QPainter &p)
{
static bool first = true;
@@ -218,6 +220,7 @@ void paint_QPixmapCachedRoundedRect(QPainter &p)
}
}
}
+#endif
void paint_pathCacheRoundedRect(QPainter &p)
{
@@ -312,7 +315,7 @@ struct {
{ "QStaticTextWithBackendOptimizations", &paint_QStaticText_optimizations },
{ "CachedText", &paint_QPixmapCachedText },
{ "RoundedRect", &paint_RoundedRect },
- { "CachedRoundedRect", &paint_QPixmapCachedRoundedRect },
+ // { "CachedRoundedRect", &paint_QPixmapCachedRoundedRect },
{ "PathCacheRoundedRect", &paint_pathCacheRoundedRect },
{ "QPixmap63x63_opaque", &paint_QPixmap63x63_opaque },
{ "QPixmap64x64_opaque", &paint_QPixmap64x64_opaque },
diff --git a/tests/benchmarks/qml/pointers/pointers.pro b/tests/benchmarks/qml/pointers/pointers.pro
index 1db474428d..b9b44abb0f 100644
--- a/tests/benchmarks/qml/pointers/pointers.pro
+++ b/tests/benchmarks/qml/pointers/pointers.pro
@@ -1,5 +1,5 @@
CONFIG += testcase
-QT += qml testlib
+QT += core-private v8-private qml-private testlib
TEMPLATE = app
TARGET = tst_pointers
macx:CONFIG -= app_bundle
diff --git a/tests/benchmarks/qml/pointers/tst_pointers.cpp b/tests/benchmarks/qml/pointers/tst_pointers.cpp
index 65dda28fe7..0c25030c7f 100644
--- a/tests/benchmarks/qml/pointers/tst_pointers.cpp
+++ b/tests/benchmarks/qml/pointers/tst_pointers.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
#include <qtest.h>
-#include "private/qqmlguard_p.h"
+#include <QtQml/private/qqmlguard_p.h>
#include <QWeakPointer>
class tst_pointers : public QObject
diff --git a/tests/benchmarks/qml/qquickwindow/tst_qquickwindow.cpp b/tests/benchmarks/qml/qquickwindow/tst_qquickwindow.cpp
index 01ddd70838..20e5fb6c64 100644
--- a/tests/benchmarks/qml/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/benchmarks/qml/qquickwindow/tst_qquickwindow.cpp
@@ -63,9 +63,9 @@ tst_qquickwindow::tst_qquickwindow()
{
window = new QQuickWindow;
window->resize(250, 250);
- window->setPos(100, 100);
+ window->setPosition(100, 100);
for ( int i=0; i<8000; i++ ) {
- QQuickRectangle *r =new QQuickRectangle(window->rootItem());
+ QQuickRectangle *r =new QQuickRectangle(window->contentItem());
for ( int j=0; j<10; ++j ) {
new QQuickRectangle(r);
}
diff --git a/tests/benchmarks/qml/typeimports/tst_typeimports.cpp b/tests/benchmarks/qml/typeimports/tst_typeimports.cpp
index c24e344a6b..5871565ace 100644
--- a/tests/benchmarks/qml/typeimports/tst_typeimports.cpp
+++ b/tests/benchmarks/qml/typeimports/tst_typeimports.cpp
@@ -67,7 +67,7 @@ public:
TestType1(QObject *parent = 0) : QObject(parent) {}
QQmlListProperty<QObject> resources() {
- return QQmlListProperty<QObject>(this, 0, resources_append);
+ return QQmlListProperty<QObject>(this, 0, resources_append, 0, 0, 0);
}
static void resources_append(QQmlListProperty<QObject> *p, QObject *o) {