QFINDTESTDATA,Android: fix 'relative to test source'
When cross-compiling for Android on Windows the 'relative to test source' option could end up possibly matching with a matching folder in root ('/') because file is a Windows path and the canonicalFilePath of that path is "". Fixes tst_qxmlstream (and possibly others) on Android when Qt is compiled on Windows. Task-number: QTBUG-68596 Change-Id: I378374e41eea80f43680b3941adaa91fa604934a Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
parent
06044df0e3
commit
22ec652ebf
@ -2135,8 +2135,9 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co
|
|||||||
srcdir.setFile(QFile::decodeName(builddir) + QLatin1String("/") + srcdir.filePath());
|
srcdir.setFile(QFile::decodeName(builddir) + QLatin1String("/") + srcdir.filePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString candidate = QString::fromLatin1("%1/%2").arg(srcdir.canonicalFilePath(), base);
|
const QString canonicalPath = srcdir.canonicalFilePath();
|
||||||
if (QFileInfo::exists(candidate)) {
|
QString candidate = QString::fromLatin1("%1/%2").arg(canonicalPath, base);
|
||||||
|
if (!canonicalPath.isEmpty() && QFileInfo::exists(candidate)) {
|
||||||
found = candidate;
|
found = candidate;
|
||||||
}
|
}
|
||||||
else if (QTestLog::verboseLevel() >= 2) {
|
else if (QTestLog::verboseLevel() >= 2) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user