diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2019-06-25 14:21:13 +0200 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@qt.io> | 2019-07-01 16:39:51 +0200 |
commit | 5a13eadaa2042e3d43328c3d5b14ca1c6c105a21 (patch) | |
tree | 60fb24c41e1e1e1aa8d0bb05d3ca95337980928d /tests | |
parent | c081cbbf6a4727c29b710b8d2bc9ac4eeda87111 (diff) |
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 <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/parserstress/tst_parserstress.cpp | 3 | ||||
-rw-r--r-- | 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); |