From b1439a30be78af06f56f83dee25be5cde5be2181 Mon Sep 17 00:00:00 2001 From: Adriano Rezende Date: Fri, 11 May 2012 12:48:06 +0200 Subject: Add more benchmark tests for Item Change-Id: I603df39d75a5eddb02a39ab08755991a0655ff19 Reviewed-by: Michael Brasser --- tests/benchmarks/qml/creation/data/CustomItem.qml | 46 +++++++++++++++++ .../qml/creation/data/emptyCustomItem.qml | 46 +++++++++++++++++ tests/benchmarks/qml/creation/data/emptyItem.qml | 46 +++++++++++++++++ .../data/itemUsingOnComponentCompleted.qml | 46 +++++++++++++++++ .../qml/creation/data/itemWithAnchoredChild.qml | 51 +++++++++++++++++++ .../creation/data/itemWithChildBindedToSize.qml | 52 +++++++++++++++++++ .../qml/creation/data/itemWithProperties.qml | 49 ++++++++++++++++++ .../data/itemWithPropertyBindingsTest1.qml | 56 ++++++++++++++++++++ .../data/itemWithPropertyBindingsTest2.qml | 56 ++++++++++++++++++++ .../data/itemWithPropertyBindingsTest3.qml | 57 +++++++++++++++++++++ .../data/itemWithPropertyBindingsTest4.qml | 59 ++++++++++++++++++++++ .../data/itemWithPropertyBindingsTest5.qml | 57 +++++++++++++++++++++ tests/benchmarks/qml/creation/tst_creation.cpp | 36 +++++++++++++ 13 files changed, 657 insertions(+) create mode 100644 tests/benchmarks/qml/creation/data/CustomItem.qml create mode 100644 tests/benchmarks/qml/creation/data/emptyCustomItem.qml create mode 100644 tests/benchmarks/qml/creation/data/emptyItem.qml create mode 100644 tests/benchmarks/qml/creation/data/itemUsingOnComponentCompleted.qml create mode 100644 tests/benchmarks/qml/creation/data/itemWithAnchoredChild.qml create mode 100644 tests/benchmarks/qml/creation/data/itemWithChildBindedToSize.qml create mode 100644 tests/benchmarks/qml/creation/data/itemWithProperties.qml create mode 100644 tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest1.qml create mode 100644 tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest2.qml create mode 100644 tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest3.qml create mode 100644 tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest4.qml create mode 100644 tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest5.qml (limited to 'tests/benchmarks') diff --git a/tests/benchmarks/qml/creation/data/CustomItem.qml b/tests/benchmarks/qml/creation/data/CustomItem.qml new file mode 100644 index 0000000000..96ce6b799d --- /dev/null +++ b/tests/benchmarks/qml/creation/data/CustomItem.qml @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + +} diff --git a/tests/benchmarks/qml/creation/data/emptyCustomItem.qml b/tests/benchmarks/qml/creation/data/emptyCustomItem.qml new file mode 100644 index 0000000000..fa92ac33ad --- /dev/null +++ b/tests/benchmarks/qml/creation/data/emptyCustomItem.qml @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +CustomItem { + +} diff --git a/tests/benchmarks/qml/creation/data/emptyItem.qml b/tests/benchmarks/qml/creation/data/emptyItem.qml new file mode 100644 index 0000000000..96ce6b799d --- /dev/null +++ b/tests/benchmarks/qml/creation/data/emptyItem.qml @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + +} diff --git a/tests/benchmarks/qml/creation/data/itemUsingOnComponentCompleted.qml b/tests/benchmarks/qml/creation/data/itemUsingOnComponentCompleted.qml new file mode 100644 index 0000000000..5040f523fc --- /dev/null +++ b/tests/benchmarks/qml/creation/data/itemUsingOnComponentCompleted.qml @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + Component.onCompleted: {} +} diff --git a/tests/benchmarks/qml/creation/data/itemWithAnchoredChild.qml b/tests/benchmarks/qml/creation/data/itemWithAnchoredChild.qml new file mode 100644 index 0000000000..2a0fa8ce67 --- /dev/null +++ b/tests/benchmarks/qml/creation/data/itemWithAnchoredChild.qml @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + width: 10 + height: 10 + + Item { + anchors.fill: parent + } +} diff --git a/tests/benchmarks/qml/creation/data/itemWithChildBindedToSize.qml b/tests/benchmarks/qml/creation/data/itemWithChildBindedToSize.qml new file mode 100644 index 0000000000..6edd2ef251 --- /dev/null +++ b/tests/benchmarks/qml/creation/data/itemWithChildBindedToSize.qml @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + width: 10 + height: 10 + + Item { + width: parent.width + height: parent.height + } +} diff --git a/tests/benchmarks/qml/creation/data/itemWithProperties.qml b/tests/benchmarks/qml/creation/data/itemWithProperties.qml new file mode 100644 index 0000000000..fd62b75457 --- /dev/null +++ b/tests/benchmarks/qml/creation/data/itemWithProperties.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + property int p1: 1 + property real p2: 1 + property bool p3: true + property string p4: "foo" +} diff --git a/tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest1.qml b/tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest1.qml new file mode 100644 index 0000000000..9ff4a65ed3 --- /dev/null +++ b/tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest1.qml @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + property int p1: obj.p1 + property real p2: obj.p2 + property bool p3: obj.p3 + property string p4: obj.p4 + + property QtObject obj: QtObject { + property int p1: 1 + property real p2: 1 + property bool p3: true + property string p4: "foo" + } +} diff --git a/tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest2.qml b/tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest2.qml new file mode 100644 index 0000000000..23bee176ed --- /dev/null +++ b/tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest2.qml @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + property int p1: obj ? obj.p1 : 0 + property real p2: obj ? obj.p2 : 0 + property bool p3: obj ? obj.p3 : false + property string p4: obj ? obj.p4 : "bar" + + property QtObject obj: QtObject { + property int p1: 1 + property real p2: 1 + property bool p3: true + property string p4: "foo" + } +} diff --git a/tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest3.qml b/tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest3.qml new file mode 100644 index 0000000000..90bc2b0916 --- /dev/null +++ b/tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest3.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + property int p1: obj.p1 + property real p2: obj.p2 + property bool p3: obj.p3 + property string p4: obj.p4 + + QtObject { + id: obj + property int p1: 1 + property real p2: 1 + property bool p3: true + property string p4: "foo" + } +} diff --git a/tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest4.qml b/tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest4.qml new file mode 100644 index 0000000000..1df55c7fc2 --- /dev/null +++ b/tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest4.qml @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + property int p1: foo.p1 + property real p2: foo.p2 + property bool p3: foo.p3 + property string p4: foo.p4 + + property alias foo: obj + + QtObject { + id: obj + property int p1: 1 + property real p2: 1 + property bool p3: true + property string p4: "foo" + } +} diff --git a/tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest5.qml b/tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest5.qml new file mode 100644 index 0000000000..74a5346517 --- /dev/null +++ b/tests/benchmarks/qml/creation/data/itemWithPropertyBindingsTest5.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + property alias p1: obj.p1 + property alias p2: obj.p2 + property alias p3: obj.p3 + property alias p4: obj.p4 + + QtObject { + id: obj + property int p1: 1 + property real p2: 1 + property bool p3: true + property string p4: "foo" + } +} diff --git a/tests/benchmarks/qml/creation/tst_creation.cpp b/tests/benchmarks/qml/creation/tst_creation.cpp index 6bdaae48fd..07242f483f 100644 --- a/tests/benchmarks/qml/creation/tst_creation.cpp +++ b/tests/benchmarks/qml/creation/tst_creation.cpp @@ -79,6 +79,9 @@ private slots: void elements_data(); void elements(); + void itemtests_qml_data(); + void itemtests_qml(); + private: QQmlEngine engine; }; @@ -356,6 +359,39 @@ void tst_creation::elements() } } +void tst_creation::itemtests_qml_data() +{ + QTest::addColumn("filepath"); + + QTest::newRow("emptyItem") << "emptyItem.qml"; + QTest::newRow("emptyCustomItem") << "emptyCustomItem.qml"; + QTest::newRow("itemWithProperties") << "itemWithProperties.qml"; + QTest::newRow("itemUsingOnComponentCompleted") << "itemUsingOnComponentCompleted.qml"; + QTest::newRow("itemWithAnchoredChild") << "itemWithAnchoredChild.qml"; + QTest::newRow("itemWithChildBindedToSize") << "itemWithChildBindedToSize.qml"; + QTest::newRow("itemWithPropertyBindingsTest1") << "itemWithPropertyBindingsTest1.qml"; + QTest::newRow("itemWithPropertyBindingsTest2") << "itemWithPropertyBindingsTest2.qml"; + QTest::newRow("itemWithPropertyBindingsTest3") << "itemWithPropertyBindingsTest3.qml"; + QTest::newRow("itemWithPropertyBindingsTest4") << "itemWithPropertyBindingsTest4.qml"; + QTest::newRow("itemWithPropertyBindingsTest5") << "itemWithPropertyBindingsTest5.qml"; +} + +void tst_creation::itemtests_qml() +{ + QFETCH(QString, filepath); + + QUrl url = TEST_FILE(filepath); + QQmlComponent component(&engine, url); + + if (!component.isReady()) { + qWarning() << "Unable to create component: " << url; + return; + } + + delete component.create(); + QBENCHMARK { delete component.create(); } +} + QTEST_MAIN(tst_creation) #include "tst_creation.moc" -- cgit v1.2.3