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/qml') 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