aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/shared/util.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-25 10:50:14 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-25 10:50:15 +0200
commite1a6475a2a3ea46b2afbc2f154c18b255466dad7 (patch)
tree6e400e8def7a391c05d9b6ce174f1f6490544d18 /tests/auto/shared/util.cpp
parentb09cf7966fdf8a6949acd912cfb054556d155ee8 (diff)
parent5ca18a3f21083151b771f0efa2a2605f183c8166 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Diffstat (limited to 'tests/auto/shared/util.cpp')
-rw-r--r--tests/auto/shared/util.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/shared/util.cpp b/tests/auto/shared/util.cpp
index e9e58993..2f6b7f54 100644
--- a/tests/auto/shared/util.cpp
+++ b/tests/auto/shared/util.cpp
@@ -53,7 +53,9 @@ QQmlDataTest::QQmlDataTest() :
m_dataDirectory(QTest::qFindTestData("data", QT_QMLTEST_DATADIR, 0)),
#endif
- m_dataDirectoryUrl(QUrl::fromLocalFile(m_dataDirectory + QLatin1Char('/')))
+ m_dataDirectoryUrl(m_dataDirectory.startsWith(QLatin1Char(':'))
+ ? QUrl(QLatin1String("qrc") + m_dataDirectory)
+ : QUrl::fromLocalFile(m_dataDirectory + QLatin1Char('/')))
{
m_instance = this;
}
@@ -67,7 +69,8 @@ void QQmlDataTest::initTestCase()
{
QVERIFY2(!m_dataDirectory.isEmpty(), "'data' directory not found");
m_directory = QFileInfo(m_dataDirectory).absolutePath();
- QVERIFY2(QDir::setCurrent(m_directory), qPrintable(QLatin1String("Could not chdir to ") + m_directory));
+ if (m_dataDirectoryUrl.scheme() != QLatin1String("qrc"))
+ QVERIFY2(QDir::setCurrent(m_directory), qPrintable(QLatin1String("Could not chdir to ") + m_directory));
}
QString QQmlDataTest::testFile(const QString &fileName) const