aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-12-22 09:50:29 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-01-04 14:52:54 +0000
commitaa697c083ea304f3e2acd79dbb0ca4b600cd678b (patch)
tree2a761128478d87d05b537bc6cf8b3d53808ab368
parent3238503a3e831c8b55678f25614acf11f41d370c (diff)
tst_qqmlenginecleanup::test_customModuleCleanup(): Add error output
The test fails for MinGW in the CI for unknown reasons. Output the error string on failure. Change-Id: I96415c9d5753f9013be22b55884175fda6604130 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit cffae9109eecc838a5b107cc58f43637a3c3279e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp
index 26b2b839ea..a35fb4ac32 100644
--- a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp
+++ b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp
@@ -171,20 +171,28 @@ void tst_qqmlenginecleanup::test_valueTypeProviderModule()
QVERIFY(noDangling);
}
+static QByteArray msgModuleCleanupFail(int attempt, const QQmlComponent &c)
+{
+ return "Attempt #" + QByteArray::number(attempt) + " :"
+ + c.errorString().toUtf8();
+}
+
void tst_qqmlenginecleanup::test_customModuleCleanup()
{
for (int i = 0; i < 5; ++i) {
qmlClearTypeRegistrations();
QQmlEngine engine;
+ engine.setOutputWarningsToStandardError(true);
engine.addImportPath(QT_TESTCASE_BUILDDIR);
QQmlComponent component(&engine);
component.setData("import CustomModule 1.0\nModuleType {}", QUrl());
- QCOMPARE(component.status(), QQmlComponent::Ready);
+ QVERIFY2(component.status() == QQmlComponent::Ready,
+ msgModuleCleanupFail(i, component).constData());
QScopedPointer<QObject> object(component.create());
- QVERIFY(!object.isNull());
+ QVERIFY2(!object.isNull(), msgModuleCleanupFail(i, component).constData());
}
}