aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/auto.pro6
-rw-r--r--tests/auto/controls/data/tst_abstractbutton.qml4
-rw-r--r--tests/auto/controls/data/tst_combobox.qml1
-rw-r--r--tests/auto/controls/data/tst_pageindicator.qml5
-rw-r--r--tests/auto/controls/data/tst_pane.qml4
-rw-r--r--tests/auto/controls/data/tst_popup.qml6
-rw-r--r--tests/auto/controls/data/tst_stackview.qml20
-rw-r--r--tests/auto/controls/data/tst_tooltip.qml6
-rw-r--r--tests/auto/popup/data/closeOnEscapeWithNestedPopups.qml112
-rw-r--r--tests/auto/popup/tst_popup.cpp68
-rw-r--r--tests/auto/revisions/tst_revisions.cpp31
-rw-r--r--tests/auto/snippets/tst_snippets.cpp18
-rw-r--r--tests/benchmarks/objectcount/tst_objectcount.cpp86
13 files changed, 286 insertions, 81 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 1947b177..ebc0b337 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -20,3 +20,9 @@ SUBDIRS += \
revisions \
sanity \
snippets
+
+# QTBUG-60268
+boot2qt: SUBDIRS -= applicationwindow calendar controls cursor \
+ drawer focus menu platform popup qquickmaterialstyle \
+ qquickmaterialstyleconf qquickuniversalstyle \
+ qquickuniversalstyleconf snippets
diff --git a/tests/auto/controls/data/tst_abstractbutton.qml b/tests/auto/controls/data/tst_abstractbutton.qml
index 422d13b4..bddb952f 100644
--- a/tests/auto/controls/data/tst_abstractbutton.qml
+++ b/tests/auto/controls/data/tst_abstractbutton.qml
@@ -147,7 +147,7 @@ TestCase {
}
function test_keyEvents(data) {
- var container = keyCatcher.createObject(testCase)
+ var container = createTemporaryObject(keyCatcher, testCase)
verify(container)
var control = button.createObject(container)
@@ -161,7 +161,5 @@ TestCase {
keyRelease(data.key)
compare(container.lastKeyRelease, data.result)
-
- container.destroy()
}
}
diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml
index 853a69e6..3d8777b3 100644
--- a/tests/auto/controls/data/tst_combobox.qml
+++ b/tests/auto/controls/data/tst_combobox.qml
@@ -1133,6 +1133,7 @@ TestCase {
control.popup.open()
compare(control.highlightedIndex, 99)
tryCompare(openedSpy, "count", 2)
+ tryVerify(function() { return listview.height > 0 })
var last = listview.itemAt(0, listview.contentY + listview.height - 1)
verify(last)
diff --git a/tests/auto/controls/data/tst_pageindicator.qml b/tests/auto/controls/data/tst_pageindicator.qml
index 6d2842c4..86c0bd8b 100644
--- a/tests/auto/controls/data/tst_pageindicator.qml
+++ b/tests/auto/controls/data/tst_pageindicator.qml
@@ -84,7 +84,7 @@ TestCase {
}
function test_interactive() {
- var control = createTemporaryObject(pageIndicator, testCase, {count: 5})
+ var control = createTemporaryObject(pageIndicator, testCase, {count: 5, spacing: 10, padding: 10})
verify(control)
verify(!control.interactive)
@@ -100,9 +100,6 @@ TestCase {
compare(control.currentIndex, 2)
// test also clicking outside delegates => the nearest should be selected
- control.padding = 10
- control.spacing = 10
-
for (var i = 0; i < control.count; ++i) {
var child = control.contentItem.children[i]
for (var x = -2; x <= child.width + 2; ++x) {
diff --git a/tests/auto/controls/data/tst_pane.qml b/tests/auto/controls/data/tst_pane.qml
index f495a159..0d7e6536 100644
--- a/tests/auto/controls/data/tst_pane.qml
+++ b/tests/auto/controls/data/tst_pane.qml
@@ -152,15 +152,13 @@ TestCase {
}
function test_implicitContentItem() {
- var control = pane.createObject(testCase, {width: 100, height: 100})
+ var control = createTemporaryObject(pane, testCase, {width: 100, height: 100})
verify(control)
compare(control.width, 100)
compare(control.height, 100)
compare(control.contentItem.width, control.availableWidth)
compare(control.contentItem.height, control.availableHeight)
-
- control.destroy()
}
function test_press() {
diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml
index beae39d1..bec50ad0 100644
--- a/tests/auto/controls/data/tst_popup.qml
+++ b/tests/auto/controls/data/tst_popup.qml
@@ -197,7 +197,7 @@ TestCase {
}
function test_availableSize() {
- var control = popupTemplate.createObject(testCase)
+ var control = createTemporaryObject(popupTemplate, testCase)
verify(control)
var availableWidthSpy = createTemporaryObject(signalSpy, testCase, {target: control, signalName: "availableWidthChanged"})
@@ -1247,12 +1247,10 @@ TestCase {
}
function test_windowParent() {
- var control = popupControl.createObject(applicationWindow, {width: 100, height: 100})
+ var control = createTemporaryObject(popupControl, applicationWindow, {width: 100, height: 100})
verify(control)
control.open()
verify(control.visible)
-
- control.destroy()
}
}
diff --git a/tests/auto/controls/data/tst_stackview.qml b/tests/auto/controls/data/tst_stackview.qml
index 37bd5222..3328c84f 100644
--- a/tests/auto/controls/data/tst_stackview.qml
+++ b/tests/auto/controls/data/tst_stackview.qml
@@ -221,21 +221,33 @@ TestCase {
function test_depth() {
var control = createTemporaryObject(stackView, testCase)
verify(control)
+ var depthSpy = signalSpy.createObject(control, {target: control, signalName: "depthChanged"})
+ verify(depthSpy.valid)
compare(control.depth, 0)
control.push(item, StackView.Immediate)
compare(control.depth, 1)
+ compare(depthSpy.count, 1)
control.clear()
compare(control.depth, 0)
+ compare(depthSpy.count, 2)
control.push(component, StackView.Immediate)
compare(control.depth, 1)
+ compare(depthSpy.count, 3)
control.push(component, StackView.Immediate)
compare(control.depth, 2)
+ compare(depthSpy.count, 4)
control.pop(StackView.Immediate)
compare(control.depth, 1)
+ compare(depthSpy.count, 5)
control.pop(StackView.Immediate) // ignored
compare(control.depth, 1)
+ compare(depthSpy.count, 5)
control.clear()
compare(control.depth, 0)
+ compare(depthSpy.count, 6)
+ control.clear()
+ compare(control.depth, 0)
+ compare(depthSpy.count, 6)
}
function test_size() {
@@ -1022,7 +1034,7 @@ TestCase {
}
function test_pushSameItem() {
- var control = stackView.createObject(testCase)
+ var control = createTemporaryObject(stackView, testCase)
verify(control)
control.push(item, StackView.Immediate)
@@ -1045,12 +1057,10 @@ TestCase {
verify(current !== item)
compare(control.currentItem, current)
compare(control.depth, 3)
-
- control.destroy()
}
function test_visible() {
- var control = stackView.createObject(testCase)
+ var control = createTemporaryObject(stackView, testCase)
verify(control)
var item1 = component.createObject(control)
@@ -1098,8 +1108,6 @@ TestCase {
control.pop(StackView.Immediate)
compare(item1.visible, true)
compare(item1.StackView.visible, true)
-
- control.destroy()
}
function test_resolve() {
diff --git a/tests/auto/controls/data/tst_tooltip.qml b/tests/auto/controls/data/tst_tooltip.qml
index 4f1831ce..66fb50c1 100644
--- a/tests/auto/controls/data/tst_tooltip.qml
+++ b/tests/auto/controls/data/tst_tooltip.qml
@@ -121,6 +121,11 @@ TestCase {
var item2 = createTemporaryObject(mouseArea, testCase)
verify(item2)
+ // Reset the properties to the expected default values, in case
+ // we're not the first test that uses attached properties to be run.
+ var sharedTip = ToolTip.toolTip
+ sharedTip[data.property] = data.defaultValue
+
compare(item1.ToolTip[data.property], data.defaultValue)
compare(item2.ToolTip[data.property], data.defaultValue)
@@ -130,7 +135,6 @@ TestCase {
var spy2 = signalSpy.createObject(item2, {target: item2.ToolTip, signalName: data.signalName})
verify(spy2.valid)
- var sharedTip = ToolTip.toolTip
sharedSpy.signalName = data.signalName
verify(sharedSpy.valid)
sharedSpy.clear()
diff --git a/tests/auto/popup/data/closeOnEscapeWithNestedPopups.qml b/tests/auto/popup/data/closeOnEscapeWithNestedPopups.qml
new file mode 100644
index 00000000..53dae0f9
--- /dev/null
+++ b/tests/auto/popup/data/closeOnEscapeWithNestedPopups.qml
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Controls 2.2
+
+ApplicationWindow {
+ width: 400
+ height: 400
+
+ header: ToolBar {
+ ToolButton {
+ objectName: "optionsToolButton"
+ text: "Options"
+ onClicked: optionsMenu.open()
+
+ Menu {
+ id: optionsMenu
+ objectName: "optionsMenu"
+ x: parent.width - width
+ transformOrigin: Menu.TopRight
+
+ MenuItem {
+ objectName: "settingsMenuItem"
+ text: "Settings"
+ onTriggered: settingsDialog.open()
+ }
+ }
+ }
+ }
+
+ Shortcut {
+ sequence: "Esc"
+ enabled: stackView.depth > 1
+ onActivated: stackView.pop()
+ }
+
+ Component {
+ id: itemComponent
+
+ Item {}
+ }
+
+ StackView {
+ id: stackView
+ objectName: "stackView"
+ anchors.fill: parent
+ initialItem: Item {
+ objectName: "initialStackViewItem"
+ }
+
+ Component.onCompleted: push(itemComponent)
+ }
+
+ Dialog {
+ id: settingsDialog
+ objectName: "settingsDialog"
+ modal: true
+
+ contentItem: ComboBox {
+ objectName: "comboBox"
+ model: 10
+ }
+ }
+}
diff --git a/tests/auto/popup/tst_popup.cpp b/tests/auto/popup/tst_popup.cpp
index 9001c3ee..1b4f0aca 100644
--- a/tests/auto/popup/tst_popup.cpp
+++ b/tests/auto/popup/tst_popup.cpp
@@ -41,10 +41,12 @@
#include <QtGui/qpa/qwindowsysteminterface.h>
#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
+#include <QtQuickTemplates2/private/qquickcombobox_p.h>
#include <QtQuickTemplates2/private/qquickoverlay_p.h>
#include <QtQuickTemplates2/private/qquickpopup_p.h>
#include <QtQuickTemplates2/private/qquickbutton_p.h>
#include <QtQuickTemplates2/private/qquickslider_p.h>
+#include <QtQuickTemplates2/private/qquickstackview_p.h>
using namespace QQuickVisualTestUtil;
@@ -76,6 +78,7 @@ private slots:
void grabber();
void cursorShape();
void componentComplete();
+ void closeOnEscapeWithNestedPopups();
};
void tst_popup::initTestCase()
@@ -838,6 +841,71 @@ void tst_popup::componentComplete()
QVERIFY(qmlPopup->isComponentComplete());
}
+void tst_popup::closeOnEscapeWithNestedPopups()
+{
+ // Tests the scenario in the Gallery example, where there are nested popups that should
+ // close in the correct order when the Escape key is pressed.
+ QQuickApplicationHelper helper(this, QStringLiteral("closeOnEscapeWithNestedPopups.qml"));
+ QQuickApplicationWindow *window = helper.appWindow;
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
+
+ // The stack view should have two items, and it should pop the second when escape is pressed
+ // and it has focus.
+ QQuickStackView *stackView = window->findChild<QQuickStackView*>("stackView");
+ QVERIFY(stackView);
+ QCOMPARE(stackView->depth(), 2);
+
+ QQuickItem *optionsToolButton = window->findChild<QQuickItem*>("optionsToolButton");
+ QVERIFY(optionsToolButton);
+
+ // Click on the options tool button. The settings menu should pop up.
+ const QPoint optionsToolButtonCenter = optionsToolButton->mapToScene(
+ QPointF(optionsToolButton->width() / 2, optionsToolButton->height() / 2)).toPoint();
+ QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier, optionsToolButtonCenter);
+
+ QQuickPopup *optionsMenu = window->findChild<QQuickPopup*>("optionsMenu");
+ QVERIFY(optionsMenu);
+ QTRY_VERIFY(optionsMenu->isVisible());
+
+ QQuickItem *settingsMenuItem = window->findChild<QQuickItem*>("settingsMenuItem");
+ QVERIFY(settingsMenuItem);
+
+ // Click on the settings menu item. The settings dialog should pop up.
+ const QPoint settingsMenuItemCenter = settingsMenuItem->mapToScene(
+ QPointF(settingsMenuItem->width() / 2, settingsMenuItem->height() / 2)).toPoint();
+ QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier, settingsMenuItemCenter);
+
+ QQuickPopup *settingsDialog = window->contentItem()->findChild<QQuickPopup*>("settingsDialog");
+ QVERIFY(settingsDialog);
+ QTRY_VERIFY(settingsDialog->isVisible());
+
+ QQuickComboBox *comboBox = window->contentItem()->findChild<QQuickComboBox*>("comboBox");
+ QVERIFY(comboBox);
+
+ // Click on the combo box button. The combo box popup should pop up.
+ const QPoint comboBoxCenter = comboBox->mapToScene(
+ QPointF(comboBox->width() / 2, comboBox->height() / 2)).toPoint();
+ QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier, comboBoxCenter);
+ QTRY_VERIFY(comboBox->popup()->isVisible());
+
+ // Close the combo box popup with the escape key. The settings dialog should still be visible.
+ QTest::keyClick(window, Qt::Key_Escape);
+ QTRY_VERIFY(!comboBox->popup()->isVisible());
+ QVERIFY(settingsDialog->isVisible());
+
+ // Close the settings dialog with the escape key.
+ QTest::keyClick(window, Qt::Key_Escape);
+ QTRY_VERIFY(!settingsDialog->isVisible());
+
+ // The stack view should still have two items.
+ QCOMPARE(stackView->depth(), 2);
+
+ // Remove one by pressing the Escape key (the Shortcut should be activated).
+ QTest::keyClick(window, Qt::Key_Escape);
+ QCOMPARE(stackView->depth(), 1);
+}
+
QTEST_MAIN(tst_popup)
#include "tst_popup.moc"
diff --git a/tests/auto/revisions/tst_revisions.cpp b/tests/auto/revisions/tst_revisions.cpp
index 8a7a5d6e..606cea33 100644
--- a/tests/auto/revisions/tst_revisions.cpp
+++ b/tests/auto/revisions/tst_revisions.cpp
@@ -46,6 +46,9 @@ class tst_revisions : public QObject
private slots:
void revisions_data();
void revisions();
+
+ void window_data();
+ void window();
};
void tst_revisions::revisions_data()
@@ -77,6 +80,34 @@ void tst_revisions::revisions()
QVERIFY2(!object.isNull(), qPrintable(component.errorString()));
}
+void tst_revisions::window_data()
+{
+ QTest::addColumn<int>("revision");
+ QTest::addColumn<QString>("qml");
+ QTest::addColumn<QString>("error");
+
+ // Qt 5.7: 2.0, Qt 5.8: 2.1
+ for (int i = 0; i <= 1; ++i)
+ QTest::newRow(qPrintable(QString("screen:2.%1").arg(i))) << i << "screen: null" << QString(":1 \"ApplicationWindow.screen\" is not available in QtQuick.Templates 2.%1").arg(i);
+
+ // Qt 5.9: 2.2, Qt 5.10: 2.3...
+ for (int i = 2; i <= QT_VERSION_MINOR - 7; ++i)
+ QTest::newRow(qPrintable(QString("screen:2.%1").arg(i))) << i << "screen: null" << "";
+}
+
+void tst_revisions::window()
+{
+ QFETCH(int, revision);
+ QFETCH(QString, qml);
+ QFETCH(QString, error);
+
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.setData(QString("import QtQuick.Templates 2.%1; ApplicationWindow { %2 }").arg(revision).arg(qml).toUtf8(), QUrl());
+ QScopedPointer<QObject> window(component.create());
+ QCOMPARE(window.isNull(), !error.isEmpty());
+}
+
QTEST_MAIN(tst_revisions)
#include "tst_revisions.moc"
diff --git a/tests/auto/snippets/tst_snippets.cpp b/tests/auto/snippets/tst_snippets.cpp
index 1185bde9..852c98e9 100644
--- a/tests/auto/snippets/tst_snippets.cpp
+++ b/tests/auto/snippets/tst_snippets.cpp
@@ -113,11 +113,23 @@ void tst_Snippets::verify()
if (takeScreenshots) {
const QString currentDataTag = QLatin1String(QTest::currentDataTag());
- static const QString currentStyle = QQuickStyle::name();
+ static const QString applicationStyle = QQuickStyle::name().isEmpty() ? "Default" : QQuickStyle::name();
static const QStringList availableStyles = QQuickStyle::availableStyles();
+
+ bool isStyledSnippet = false;
+ const QString snippetStyle = currentDataTag.section("-", 1, 1);
for (const QString &availableStyle : availableStyles) {
- if (currentStyle != availableStyle && currentDataTag.startsWith("qtquickcontrols2-" + availableStyle.toLower() + "-"))
- QSKIP(qPrintable(QString("Not running with the %1 style").arg(availableStyle)));
+ if (!snippetStyle.compare(availableStyle, Qt::CaseInsensitive)) {
+ if (applicationStyle != availableStyle)
+ QSKIP(qPrintable(QString("%1 style specific snippet. Running with the %2 style.").arg(availableStyle, applicationStyle)));
+ isStyledSnippet = true;
+ }
+ }
+
+ if (!isStyledSnippet && !applicationStyle.isEmpty()) {
+ int index = output.indexOf("-", output.lastIndexOf("/"));
+ if (index != -1)
+ output.insert(index, "-" + applicationStyle.toLower());
}
QQuickWindow *window = qobject_cast<QQuickWindow *>(root);
diff --git a/tests/benchmarks/objectcount/tst_objectcount.cpp b/tests/benchmarks/objectcount/tst_objectcount.cpp
index 7f0610ac..d12f3293 100644
--- a/tests/benchmarks/objectcount/tst_objectcount.cpp
+++ b/tests/benchmarks/objectcount/tst_objectcount.cpp
@@ -61,17 +61,11 @@ private slots:
void init();
void cleanup();
- void calendar();
- void calendar_data();
+ void qobjects();
+ void qobjects_data();
- void controls();
- void controls_data();
-
- void material();
- void material_data();
-
- void universal();
- void universal_data();
+ void qquickitems();
+ void qquickitems_data();
private:
QQmlEngine engine;
@@ -94,17 +88,6 @@ void tst_ObjectCount::cleanup()
qtHookData[QHooks::RemoveQObject] = 0;
}
-static void printItems(const QList<QQuickItem *> &items)
-{
- std::cout << "RESULT tst_ObjectCount::" << QTest::currentTestFunction() << "():\"" << QTest::currentDataTag() << "\":" << std::endl;
- std::cout << " QQuickItems: " << items.count() << " (total of QObjects: " << qt_qobjects->count() << ")" << std::endl;
-
- if (qt_verbose) {
- for (QObject *object : qAsConst(*qt_qobjects))
- qInfo() << "\t" << object;
- }
-}
-
static void addTestRows(QQmlEngine *engine, const QString &sourcePath, const QString &targetPath, const QStringList &skiplist = QStringList())
{
// We cannot use QQmlComponent to load QML files directly from the source tree.
@@ -138,6 +121,14 @@ static void addTestRows(QQmlEngine *engine, const QString &sourcePath, const QSt
}
}
+static void initTestRows(QQmlEngine *engine)
+{
+ addTestRows(engine, "controls", "QtQuick/Controls.2", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
+ addTestRows(engine, "controls/material", "QtQuick/Controls.2/Material", QStringList() << "Ripple" << "SliderHandle" << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator" << "BoxShadow" << "ElevationEffect" << "CursorDelegate");
+ addTestRows(engine, "controls/universal", "QtQuick/Controls.2/Universal", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
+}
+
+template <typename T>
static void doBenchmark(QQmlEngine *engine, const QUrl &url)
{
QQmlComponent component(engine);
@@ -148,61 +139,42 @@ static void doBenchmark(QQmlEngine *engine, const QUrl &url)
QScopedPointer<QObject> object(component.create());
QVERIFY2(object.data(), qPrintable(component.errorString()));
- QList<QQuickItem *> items;
- for (QObject *object : qAsConst(*qt_qobjects)) {
- QQuickItem *item = qobject_cast<QQuickItem *>(object);
- if (item)
- items += item;
+ QObjectList objects;
+ for (QObject *object : qAsConst(*qt_qobjects())) {
+ if (qobject_cast<T *>(object))
+ objects += object;
}
- printItems(items);
-}
-void tst_ObjectCount::calendar()
-{
- QFETCH(QUrl, url);
- doBenchmark(&engine, url);
-}
-
-void tst_ObjectCount::calendar_data()
-{
- QTest::addColumn<QUrl>("url");
- addTestRows(&engine, "calendar", "Qt/labs/calendar");
-}
-
-void tst_ObjectCount::controls()
-{
- QFETCH(QUrl, url);
- doBenchmark(&engine, url);
-}
+ if (qt_verbose) {
+ for (QObject *object : objects)
+ qInfo() << "\t" << object;
+ }
-void tst_ObjectCount::controls_data()
-{
- QTest::addColumn<QUrl>("url");
- addTestRows(&engine, "controls", "QtQuick/Controls.2", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
+ QTest::setBenchmarkResult(objects.count(), QTest::Events);
}
-void tst_ObjectCount::material()
+void tst_ObjectCount::qobjects()
{
QFETCH(QUrl, url);
- doBenchmark(&engine, url);
+ doBenchmark<QObject>(&engine, url);
}
-void tst_ObjectCount::material_data()
+void tst_ObjectCount::qobjects_data()
{
QTest::addColumn<QUrl>("url");
- addTestRows(&engine, "controls/material", "QtQuick/Controls.2/Material", QStringList() << "Ripple" << "SliderHandle" << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator" << "BoxShadow" << "ElevationEffect" << "CursorDelegate");
+ initTestRows(&engine);
}
-void tst_ObjectCount::universal()
+void tst_ObjectCount::qquickitems()
{
QFETCH(QUrl, url);
- doBenchmark(&engine, url);
+ doBenchmark<QQuickItem>(&engine, url);
}
-void tst_ObjectCount::universal_data()
+void tst_ObjectCount::qquickitems_data()
{
QTest::addColumn<QUrl>("url");
- addTestRows(&engine, "controls/universal", "QtQuick/Controls.2/Universal", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
+ initTestRows(&engine);
}
QTEST_MAIN(tst_ObjectCount)