From 65e642f13d5e21d104806179b73dddfeb7b6dc81 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 4 May 2016 13:51:05 +0200 Subject: Make it possible to call some benchmark functions directly Some benchmarks - such as "elements" - rely on QQmlMetaType::qmlTypeNames(), which is implicitly populated when other benchmarks import for example QtQuick. However when calling them directly, the benchmark data set is much smaller. Therefore let's add QtQuick to the "base" set that is always available. Change-Id: I4b3696a426854195deb1c31ad24d80427da7b340 Reviewed-by: Robin Burchell --- tests/benchmarks/qml/creation/tst_creation.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/benchmarks') diff --git a/tests/benchmarks/qml/creation/tst_creation.cpp b/tests/benchmarks/qml/creation/tst_creation.cpp index 4b985d00f1..38ab577120 100644 --- a/tests/benchmarks/qml/creation/tst_creation.cpp +++ b/tests/benchmarks/qml/creation/tst_creation.cpp @@ -100,6 +100,12 @@ public: tst_creation::tst_creation() { qmlRegisterType("Qt.test", 1, 0, "TestType"); + + // Ensure QtQuick is loaded and imported. Some benchmark like elements() rely on QQmlMetaType::qmlTypeNames() to + // be populated. + QQmlComponent component(&engine); + component.setData("import QtQuick 2.0\nItem{}", QUrl()); + QScopedPointer obj(component.create()); } inline QUrl TEST_FILE(const QString &filename) -- cgit v1.2.3 From 48492b2ee5d2f9ad178982f4c16e895b3083d8df Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 21 Apr 2016 14:14:08 +0200 Subject: QML: add librarymetrics_performance to the builds. Also make sure that we can easily deploy this test to devices by putting all data inside a qrc file. Change-Id: I175830fde51332b13068b163eba3d68c0535b712 Reviewed-by: Simon Hausmann --- .../qml/librarymetrics_performance/librarymetrics_performance.pro | 2 ++ .../qml/librarymetrics_performance/tst_librarymetrics_performance.cpp | 2 +- tests/benchmarks/qml/qml.pro | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/benchmarks') diff --git a/tests/benchmarks/qml/librarymetrics_performance/librarymetrics_performance.pro b/tests/benchmarks/qml/librarymetrics_performance/librarymetrics_performance.pro index 3bedc0ea18..67f9d3b395 100644 --- a/tests/benchmarks/qml/librarymetrics_performance/librarymetrics_performance.pro +++ b/tests/benchmarks/qml/librarymetrics_performance/librarymetrics_performance.pro @@ -7,3 +7,5 @@ macx:CONFIG -= app_bundle CONFIG += release SOURCES += tst_librarymetrics_performance.cpp + +RESOURCES += data diff --git a/tests/benchmarks/qml/librarymetrics_performance/tst_librarymetrics_performance.cpp b/tests/benchmarks/qml/librarymetrics_performance/tst_librarymetrics_performance.cpp index a83c1479f2..ad72ebc6f0 100644 --- a/tests/benchmarks/qml/librarymetrics_performance/tst_librarymetrics_performance.cpp +++ b/tests/benchmarks/qml/librarymetrics_performance/tst_librarymetrics_performance.cpp @@ -119,7 +119,7 @@ tst_librarymetrics_performance::~tst_librarymetrics_performance() static QUrl testFileUrl(const char * filename) { - return QUrl::fromLocalFile(QString(QLatin1String(filename))); + return QUrl(QLatin1String("qrc:///") + QLatin1String(filename)); } void tst_librarymetrics_performance::metrics_data() diff --git a/tests/benchmarks/qml/qml.pro b/tests/benchmarks/qml/qml.pro index 7969866673..d3ce69c713 100644 --- a/tests/benchmarks/qml/qml.pro +++ b/tests/benchmarks/qml/qml.pro @@ -8,6 +8,7 @@ SUBDIRS += \ qqmlcomponent \ qqmlimage \ qqmlmetaproperty \ + librarymetrics_performance \ # script \ ### FIXME: doesn't build js -- cgit v1.2.3