aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/sanity/tst_sanity.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-04-20 10:13:21 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-04-20 15:04:45 +0000
commit7703e6a9fc397b86b2520a14fc104569ed24e07f (patch)
tree7e70ecd6bdd4e006ba3d8fa5ad71d049a18b764a /tests/auto/sanity/tst_sanity.cpp
parentb1629a78d8e8ce031d92e42d66684e2b34630d6f (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/auto/sanity/tst_sanity.cpp')
-rw-r--r--tests/auto/sanity/tst_sanity.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/sanity/tst_sanity.cpp b/tests/auto/sanity/tst_sanity.cpp
index 67c60cae..2bfa1128 100644
--- a/tests/auto/sanity/tst_sanity.cpp
+++ b/tests/auto/sanity/tst_sanity.cpp
@@ -254,7 +254,7 @@ void tst_Sanity::anchors_data()
QTest::newRow(qPrintable(it.key())) << it.key() << it.value();
}
-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
@@ -267,7 +267,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)) {
@@ -309,10 +309,10 @@ void tst_Sanity::attachedObjects()
void tst_Sanity::attachedObjects_data()
{
QTest::addColumn<QUrl>("url");
- addTestRows(&engine, "calendar");
- addTestRows(&engine, "controls", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
- addTestRows(&engine, "controls/material", QStringList() << "Ripple" << "SliderHandle" << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
- addTestRows(&engine, "controls/universal", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
+ addTestRows(&engine, "calendar", "calendar");
+ addTestRows(&engine, "controls", "controls", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
+ addTestRows(&engine, "controls/material", "controls/material", QStringList() << "Ripple" << "SliderHandle" << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
+ addTestRows(&engine, "controls/universal", "controls/universal", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
}
QTEST_MAIN(tst_Sanity)