aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/objectcount
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/objectcount')
-rw-r--r--tests/benchmarks/objectcount/objectcount.pro3
-rw-r--r--tests/benchmarks/objectcount/objectcount.qrc5
-rw-r--r--tests/benchmarks/objectcount/qt-logo.pngbin0 -> 21710 bytes
-rw-r--r--tests/benchmarks/objectcount/tst_objectcount.cpp19
4 files changed, 22 insertions, 5 deletions
diff --git a/tests/benchmarks/objectcount/objectcount.pro b/tests/benchmarks/objectcount/objectcount.pro
index f54d72d6..801fff58 100644
--- a/tests/benchmarks/objectcount/objectcount.pro
+++ b/tests/benchmarks/objectcount/objectcount.pro
@@ -7,3 +7,6 @@ osx:CONFIG -= app_bundle
SOURCES += \
tst_objectcount.cpp
+
+RESOURCES += \
+ objectcount.qrc
diff --git a/tests/benchmarks/objectcount/objectcount.qrc b/tests/benchmarks/objectcount/objectcount.qrc
new file mode 100644
index 00000000..3c2c8a64
--- /dev/null
+++ b/tests/benchmarks/objectcount/objectcount.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>qt-logo.png</file>
+</qresource>
+</RCC>
diff --git a/tests/benchmarks/objectcount/qt-logo.png b/tests/benchmarks/objectcount/qt-logo.png
new file mode 100644
index 00000000..cf350dad
--- /dev/null
+++ b/tests/benchmarks/objectcount/qt-logo.png
Binary files differ
diff --git a/tests/benchmarks/objectcount/tst_objectcount.cpp b/tests/benchmarks/objectcount/tst_objectcount.cpp
index d8493730..8caea23d 100644
--- a/tests/benchmarks/objectcount/tst_objectcount.cpp
+++ b/tests/benchmarks/objectcount/tst_objectcount.cpp
@@ -38,6 +38,8 @@
#include <QtQuick>
#include <QtCore/private/qhooks_p.h>
+static int qt_verbose = qgetenv("VERBOSE").toInt() != 0;
+
Q_GLOBAL_STATIC(QObjectList, qt_qobjects)
extern "C" Q_DECL_EXPORT void qt_addQObject(QObject *object)
@@ -72,7 +74,7 @@ void tst_ObjectCount::init()
// warmup
QQmlComponent component(&engine);
- component.setData("import QtQuick 2.0; Item { Accessible.role: Accessible.Button }", QUrl());
+ component.setData("import QtQuick 2.0; import QtQuick.Controls 1.3; import QtQuick.Controls 2.0; Image { Accessible.role: Accessible.Button; source: 'qrc:/qt-logo.png' }", QUrl());
delete component.create();
}
@@ -82,6 +84,15 @@ void tst_ObjectCount::cleanup()
qtHookData[QHooks::RemoveQObject] = 0;
}
+static void printItems(const QString &prefix, const QList<QQuickItem *> &items)
+{
+ qInfo() << prefix << "QQuickItems:" << items.count() << "(total of QObjects:" << qt_qobjects->count() << ")";
+ if (qt_verbose) {
+ foreach (QObject *object, *qt_qobjects)
+ qInfo() << "\t" << object;
+ }
+}
+
void tst_ObjectCount::testCount()
{
QFETCH(QByteArray, v1);
@@ -101,8 +112,7 @@ void tst_ObjectCount::testCount()
if (item)
items += item;
}
-
- qInfo() << "V1: QQuickItems:" << items.count() << "(total of QObjects:" << qt_qobjects->count() << ")";
+ printItems("V1", items);
}
qt_qobjects->clear();
@@ -119,8 +129,7 @@ void tst_ObjectCount::testCount()
if (item)
items += item;
}
-
- qInfo() << "V2: QQuickItems:" << items.count() << "(total of QObjects:" << qt_qobjects->count() << ")";
+ printItems("V2", items);
}
}