aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-12-22 09:50:29 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-01-04 13:32:26 +0100
commitcffae9109eecc838a5b107cc58f43637a3c3279e (patch)
tree168296d17c98d22de9540e711f73148c076081d8 /tests
parentd94921d4165b7225918c401041dd58ce2794a35d (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. Pick-to: 6.0 Change-Id: I96415c9d5753f9013be22b55884175fda6604130 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests')
-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());
}
}