diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-05-04 13:51:05 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-05-09 08:14:53 +0000 |
commit | 65e642f13d5e21d104806179b73dddfeb7b6dc81 (patch) | |
tree | 494ec24a5000cceb248504efe928ec143aba8ed1 /tests | |
parent | 4a86cbe2ca426143bac4b533a1949a1e1514d65e (diff) |
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 <robin.burchell@viroteck.net>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/benchmarks/qml/creation/tst_creation.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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<TestType>("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<QObject> obj(component.create()); } inline QUrl TEST_FILE(const QString &filename) |