diff options
Diffstat (limited to 'tests/benchmarks')
-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(); |