From aa697c083ea304f3e2acd79dbb0ca4b600cd678b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 22 Dec 2020 09:50:29 +0100 Subject: 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 (cherry picked from commit cffae9109eecc838a5b107cc58f43637a3c3279e) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tests') 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 object(component.create()); - QVERIFY(!object.isNull()); + QVERIFY2(!object.isNull(), msgModuleCleanupFail(i, component).constData()); } } -- cgit v1.2.3