diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-04-20 10:13:21 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-04-20 15:04:45 +0000 |
commit | 7703e6a9fc397b86b2520a14fc104569ed24e07f (patch) | |
tree | 7e70ecd6bdd4e006ba3d8fa5ad71d049a18b764a /tests/benchmarks/objectcount/tst_objectcount.cpp | |
parent | b1629a78d8e8ce031d92e42d66684e2b34630d6f (diff) |
Tests: prepare for the upcoming import rename
Looks like a duplicate string right now, but after the import rename,
the target path (eg. QT_INSTALL_QML/QtQuick/Controls.2/Material) and
the source path (eg. src/imports/controls/material) no longer have a
common structure, so pass both paths to addTestRows().
Change-Id: I39228ed5f23434289a5bea95977bbd0e7a378641
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/benchmarks/objectcount/tst_objectcount.cpp')
-rw-r--r-- | tests/benchmarks/objectcount/tst_objectcount.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/benchmarks/objectcount/tst_objectcount.cpp b/tests/benchmarks/objectcount/tst_objectcount.cpp index a14ea792..c0b5440b 100644 --- a/tests/benchmarks/objectcount/tst_objectcount.cpp +++ b/tests/benchmarks/objectcount/tst_objectcount.cpp @@ -105,7 +105,7 @@ static void printItems(const QList<QQuickItem *> &items) } } -static void addTestRows(QQmlEngine *engine, const QString &targetPath, const QStringList &skiplist = QStringList()) +static void addTestRows(QQmlEngine *engine, const QString &sourcePath, const QString &targetPath, const QStringList &skiplist = QStringList()) { // We cannot use QQmlComponent to load QML files directly from the source tree. // For styles that use internal QML types (eg. material/Ripple.qml), the source @@ -118,7 +118,7 @@ static void addTestRows(QQmlEngine *engine, const QString &targetPath, const QSt // the engine's import path. This way we can use QQmlComponent to load each QML file // for benchmarking. - QFileInfoList entries = QDir(QQC2_IMPORT_PATH "/" + targetPath).entryInfoList(QStringList("*.qml"), QDir::Files); + QFileInfoList entries = QDir(QQC2_IMPORT_PATH "/" + sourcePath).entryInfoList(QStringList("*.qml"), QDir::Files); foreach (const QFileInfo &entry, entries) { QString name = entry.baseName(); if (!skiplist.contains(name)) { @@ -165,7 +165,7 @@ void tst_ObjectCount::calendar() void tst_ObjectCount::calendar_data() { QTest::addColumn<QUrl>("url"); - addTestRows(&engine, "calendar"); + addTestRows(&engine, "calendar", "calendar"); } void tst_ObjectCount::controls() @@ -177,7 +177,7 @@ void tst_ObjectCount::controls() void tst_ObjectCount::controls_data() { QTest::addColumn<QUrl>("url"); - addTestRows(&engine, "controls", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator"); + addTestRows(&engine, "controls", "controls", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator"); } void tst_ObjectCount::material() @@ -189,7 +189,7 @@ void tst_ObjectCount::material() void tst_ObjectCount::material_data() { QTest::addColumn<QUrl>("url"); - addTestRows(&engine, "controls/material", QStringList() << "Ripple" << "SliderHandle" << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator"); + addTestRows(&engine, "controls/material", "controls/material", QStringList() << "Ripple" << "SliderHandle" << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator"); } void tst_ObjectCount::universal() @@ -201,7 +201,7 @@ void tst_ObjectCount::universal() void tst_ObjectCount::universal_data() { QTest::addColumn<QUrl>("url"); - addTestRows(&engine, "controls/universal", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator"); + addTestRows(&engine, "controls/universal", "controls/universal", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator"); } QTEST_MAIN(tst_ObjectCount) |