From 8864aca9e5a0b2fd727ffc010bc0e9a538f1546b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Sat, 10 Mar 2018 11:38:59 +0100 Subject: [PATCH] Make testlib selftests pass for shadow-builds Using QFileInfo to check if the file exists based on the filename alone ignores the fact that all the expected files are embedded as QRC resources. The expectedResult() function already does a similar check, so we can use that directly instead of checking twice if the file exists. Task-number: QTBUG-66981 Change-Id: I0beb8d3503ed49682ae7d7e2a5172922fab5420d Reviewed-by: Simon Hausmann --- tests/auto/testlib/selftests/tst_selftests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 35b8f226ec5..9c23574456d 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -759,8 +759,8 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge QList res = splitLines(actualOutputs[n]); QString errorMessage; QString expectedFileName = expectedFileNameFromTest(subdir, logger); - if (QFileInfo::exists(expectedFileName)) { - QByteArrayList exp = expectedResult(expectedFileName); + QByteArrayList exp = expectedResult(expectedFileName); + if (!exp.isEmpty()) { #ifdef Q_CC_MINGW // MinGW formats double numbers differently (last verified with 7.1) if (n == 0 && subdir == QStringLiteral("float")) {