From 5a13eadaa2042e3d43328c3d5b14ca1c6c105a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Arve=20S=C3=A6ther?= Date: Tue, 25 Jun 2019 14:21:13 +0200 Subject: Log all errors through testlib if a component has errors QVERIFY(!comp.isError()) gives very little diagnostics: FAIL! : tst_foo::bar() '!comp.isError()' returned FALSE instead we now use QVERIFY2(!comp.isError(), qPrintable(comp.errorString())) which outputs: FAIL! : tst_foo::bar() '!comp.isError()' returned FALSE. (file:///data/cppsignal.qml:42 No such file or directory ) Task-number: QTBUG-75567 Change-Id: If3527cd6cf38284d5a9d24c0ae476210bec53508 Reviewed-by: Friedemann Kleint --- tests/auto/qml/parserstress/tst_parserstress.cpp | 3 +-- tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/auto/qml/parserstress/tst_parserstress.cpp b/tests/auto/qml/parserstress/tst_parserstress.cpp index e32fcabaf3..11851de76e 100644 --- a/tests/auto/qml/parserstress/tst_parserstress.cpp +++ b/tests/auto/qml/parserstress/tst_parserstress.cpp @@ -130,8 +130,7 @@ void tst_parserstress::ecmascript() QCOMPARE(component.errors().at(1).line(), 142); } else { - - QVERIFY(!component.isError()); + QVERIFY2(!component.isError(), qPrintable(component.errorString())); } } diff --git a/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp b/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp index 68ed22c01c..a6f0d65453 100644 --- a/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp +++ b/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp @@ -78,7 +78,7 @@ void tst_qqmlstatemachine::tst_cppObjectSignal() CppObject cppObject; QQmlEngine engine; QQmlComponent component(&engine, testFileUrl("cppsignal.qml")); - QVERIFY(!component.isError()); + QVERIFY2(!component.isError(), qPrintable(component.errorString())); QQmlContext *ctxt = engine.rootContext(); ctxt->setContextProperty("_cppObject", &cppObject); -- cgit v1.2.3