From 6cbd098190ce4fc624f8f6427d9caa460109f324 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 4 Jan 2016 18:15:33 +0100 Subject: Support static builds Change-Id: I17bb9131603da912597777b2ec0b9be3894ed858 Reviewed-by: Mitch Curtis --- tests/benchmarks/creationtime/tst_creationtime.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'tests/benchmarks/creationtime/tst_creationtime.cpp') diff --git a/tests/benchmarks/creationtime/tst_creationtime.cpp b/tests/benchmarks/creationtime/tst_creationtime.cpp index 2a61b0ea..927dd17d 100644 --- a/tests/benchmarks/creationtime/tst_creationtime.cpp +++ b/tests/benchmarks/creationtime/tst_creationtime.cpp @@ -78,15 +78,19 @@ 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 "/" + targetPath).entryInfoList(QStringList("*.qml"), QDir::Files); foreach (const QFileInfo &entry, entries) { QString name = entry.baseName(); if (!skiplist.contains(name)) { foreach (const QString &importPath, engine->importPathList()) { - QString filePath = QDir(importPath + "/Qt/labs/" + targetPath).absoluteFilePath(entry.fileName()); + QString name = entry.dir().dirName() + "/" + entry.fileName(); + QString filePath = importPath + "/Qt/labs/" + targetPath + "/" + entry.fileName(); if (QFile::exists(filePath)) { QTest::newRow(qPrintable(name)) << QUrl::fromLocalFile(filePath); break; + } else if (QFile::exists(QQmlFile::urlToLocalFileOrQrc(filePath))) { + QTest::newRow(qPrintable(name)) << QUrl(filePath); + break; } } } @@ -117,7 +121,7 @@ void tst_CreationTime::controls() void tst_CreationTime::controls_data() { QTest::addColumn("url"); - addTestRows(&engine, "/controls"); + addTestRows(&engine, "controls"); } void tst_CreationTime::material() @@ -129,7 +133,7 @@ void tst_CreationTime::material() void tst_CreationTime::material_data() { QTest::addColumn("url"); - addTestRows(&engine, "/controls/material", QStringList() << "Ripple" << "SliderHandle"); + addTestRows(&engine, "controls/material", QStringList() << "Ripple" << "SliderHandle"); } void tst_CreationTime::universal() @@ -141,7 +145,7 @@ void tst_CreationTime::universal() void tst_CreationTime::universal_data() { QTest::addColumn("url"); - addTestRows(&engine, "/controls/universal"); + addTestRows(&engine, "controls/universal"); } void tst_CreationTime::calendar() @@ -153,7 +157,7 @@ void tst_CreationTime::calendar() void tst_CreationTime::calendar_data() { QTest::addColumn("url"); - addTestRows(&engine, "/calendar"); + addTestRows(&engine, "calendar"); } QTEST_MAIN(tst_CreationTime) -- cgit v1.2.3