diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-03-08 18:35:03 +0100 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-03-08 18:35:03 +0100 |
commit | d9ea4917ca97aeee050a86151fbfa069771b498d (patch) | |
tree | 21fd6960d8a866bf6f5a5a8f9db9be801f8065c1 /tests/benchmarks/qml/holistic/tst_holistic.cpp | |
parent | f9beafddd256cd0b79bf2478a812053ef61241fc (diff) | |
parent | c6a26c248e8abc421b87c3dd6b2466d490ea902e (diff) |
Merge remote-tracking branch 'gerrit/5.11' into wip/webassembly
Change-Id: I729af792166fd2f6c5843ba564e63adf8ae09a97
Diffstat (limited to 'tests/benchmarks/qml/holistic/tst_holistic.cpp')
-rw-r--r-- | tests/benchmarks/qml/holistic/tst_holistic.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/benchmarks/qml/holistic/tst_holistic.cpp b/tests/benchmarks/qml/holistic/tst_holistic.cpp index 791ae6812b..9186816a16 100644 --- a/tests/benchmarks/qml/holistic/tst_holistic.cpp +++ b/tests/benchmarks/qml/holistic/tst_holistic.cpp @@ -107,9 +107,6 @@ private slots: void typeResolution_data(); void typeResolution(); - -private: - QQmlEngine engine; }; tst_holistic::tst_holistic() @@ -251,6 +248,8 @@ void tst_holistic::compilation() Q_ASSERT(files.size() > 0); Q_ASSERT(repetitions > 0); + QQmlEngine engine; + QBENCHMARK { engine.clearComponentCache(); for (int i = 0; i < repetitions; ++i) { @@ -272,6 +271,8 @@ void tst_holistic::instantiation() Q_ASSERT(files.size() > 0); Q_ASSERT(repetitions > 0); + QQmlEngine engine; + QList<QQmlComponent*> components; for (int i = 0; i < files.size(); ++i) { QQmlComponent *c = new QQmlComponent(&engine, QUrl::fromLocalFile(files.at(i))); @@ -306,6 +307,8 @@ void tst_holistic::creation() Q_ASSERT(files.size() > 0); Q_ASSERT(repetitions > 0); + QQmlEngine engine; + QBENCHMARK { engine.clearComponentCache(); for (int i = 0; i < repetitions; ++i) { @@ -369,6 +372,7 @@ void tst_holistic::dynamicity() QFETCH(QVariant, writeValueTwo); QFETCH(QString, readProperty); + QQmlEngine engine; QQmlComponent c(&engine, file); QObject *obj = c.create(); @@ -478,6 +482,7 @@ void tst_holistic::cppToJsDirect() QFETCH(QString, file); QFETCH(QString, methodName); + QQmlEngine engine; QQmlComponent c(&engine, file); QObject *obj = c.create(); @@ -497,6 +502,7 @@ void tst_holistic::cppToJsIndirect() // The benchmark deliberately causes change signals to be emitted (and // modifies the scarce resources) so that the properties are updated. + QQmlEngine engine; QQmlComponent c(&engine, QString(SRCDIR + QLatin1String("/data/scopeSwitching/ScarceTwo.qml"))); QObject *obj = c.create(); @@ -560,6 +566,7 @@ void tst_holistic::typeResolution() Q_ASSERT(propertyNameTwo.size() == propertyValueTwo.size()); Q_ASSERT(repetitions > 0); + QQmlEngine engine; QQmlComponent c(&engine, file); QObject *obj = c.create(); |