From cd4820fbbe1bd1d8a3ba74fcfc91c4264682b602 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Fri, 31 May 2013 14:48:24 +0200 Subject: Fix compilation of QML benchmarks Change-Id: I2d612108ec8d69a0a9318cd26f6adcbb74f34138 Reviewed-by: Lars Knoll --- tests/benchmarks/qml/animation/animation.pro | 5 ++--- tests/benchmarks/qml/compilation/tst_compilation.cpp | 6 ++++-- tests/benchmarks/qml/creation/creation.pro | 3 +-- tests/benchmarks/qml/creation/tst_creation.cpp | 8 +------- tests/benchmarks/qml/holistic/testtypes.cpp | 14 +++++++------- tests/benchmarks/qml/painting/paintbenchmark.cpp | 5 ++++- tests/benchmarks/qml/pointers/pointers.pro | 2 +- tests/benchmarks/qml/pointers/tst_pointers.cpp | 2 +- tests/benchmarks/qml/qquickwindow/tst_qquickwindow.cpp | 4 ++-- tests/benchmarks/qml/typeimports/tst_typeimports.cpp | 2 +- 10 files changed, 24 insertions(+), 27 deletions(-) (limited to 'tests/benchmarks') diff --git a/tests/benchmarks/qml/animation/animation.pro b/tests/benchmarks/qml/animation/animation.pro index 7490c5fe39..adf83828fa 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 v8-private macx:CONFIG -= app_bundle SOURCES += tst_animation.cpp DEFINES += SRCDIR=\\\"$$PWD\\\" - -QT += testlib core-private gui-private qml-private quick-private v8-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 #include #include -#include #include class tst_creation : public QObject @@ -96,7 +95,7 @@ public: : QObject(parent) {} QQmlListProperty resources() { - return QQmlListProperty(this, 0, resources_append); + return QQmlListProperty(this, 0, resources_append, 0, 0, 0); } static void resources_append(QQmlListProperty *p, QObject *o) { @@ -107,9 +106,6 @@ public: tst_creation::tst_creation() { qmlRegisterType("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("Qt.test", 1,0, "MyScarceResourceProvider"); qmlRegisterType("Qt.test", 1,0, "MyArbitraryVariantProvider"); - qmlRegisterSingletonType("Qt.test",1,0,script_api); // register (script) singleton Type for an existing uri which contains elements - qmlRegisterSingletonType("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("Qt.test.qobjectApi",1,0,qobject_api); // register (qobject) singleton Type for a uri which doesn't contain elements - qmlRegisterSingletonType("Qt.test.qobjectApi",1,3,qobject_api); // register (qobject) singleton Type for a uri which doesn't contain elements, minor version set - qmlRegisterSingletonType("Qt.test.qobjectApi",2,0,qobject_api); // register (qobject) singleton Type for a uri which doesn't contain elements, major version set - qmlRegisterSingletonType("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("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("Qt.test.qobjectApi",1,0,"QObject",qobject_api); // register (qobject) singleton Type for a uri which doesn't contain elements + qmlRegisterSingletonType("Qt.test.qobjectApi",1,3,"QObject",qobject_api); // register (qobject) singleton Type for a uri which doesn't contain elements, minor version set + qmlRegisterSingletonType("Qt.test.qobjectApi",2,0,"QObject",qobject_api); // register (qobject) singleton Type for a uri which doesn't contain elements, major version set + qmlRegisterSingletonType("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 -#include "private/qqmlguard_p.h" +#include #include 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 resources() { - return QQmlListProperty(this, 0, resources_append); + return QQmlListProperty(this, 0, resources_append, 0, 0, 0); } static void resources_append(QQmlListProperty *p, QObject *o) { -- cgit v1.2.3