summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-07-22 14:33:04 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-07-22 23:23:24 +0200
commite5761061f288d9e16ba3816f4d43fdb9b6decd25 (patch)
treeca5b8769d297703a3a2aa28d84c72d474cb2b576 /tests
parent1a189c070177bd68fb6adf7b57ae468243174bd0 (diff)
testlib selftest: Only warn about missing test expectation if none was found
Change-Id: I55e19d0a7b9b58ceeee4f25612f4a1d9ec66eb76 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp
index e63f8a427f..0e5d947bc4 100644
--- a/tests/auto/testlib/selftests/tst_selftests.cpp
+++ b/tests/auto/testlib/selftests/tst_selftests.cpp
@@ -868,6 +868,7 @@ void checkTestOutput(const QString &test, const TestLogger &logger, const QByteA
return true;
};
+ bool foundExpectionFile = false;
for (int version = 0; !expectationMatched; ++version) {
// Look for a test expectation file. Most tests only have a single
// expectation file, while some have multiple versions that should
@@ -888,12 +889,14 @@ void checkTestOutput(const QString &test, const TestLogger &logger, const QByteA
} else {
// No more versions found, and still no match
assert(!expectationMatched);
- outputMessage += "Could not find any expectation files for subtest '" + test + "'";
+ if (!foundExpectionFile)
+ outputMessage += "Could not find any expectation files for subtest '" + test + "'";
break;
}
}
// Found expected result
+ foundExpectionFile = true;
QString errorMessage;
auto expectedLines = splitLines(expected);
if (compareOutput(logger.shortName(), test, actual, actualLines, expectedLines, &errorMessage)) {