Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
None
-
5.7.0
-
None
Description
It is difficult to test warnings in QML tests, when there are QML warnings with line numbers involved. When the tested component instance is created within the test QML file, the warning URL must manually resolved and the line numbers must be updated whenever the tests change in a way that it affects the line numbers. For example, adding an import.
TestCase { id: testCase Component { id: testComponent FooBar { } } function test_something() { var object = testComponent.createObject(testCase) ignoreWarning(Qt.resolvedUrl("tst_foo.qml") + ":123:45: QML FooBar: cannot do something so i'm throwing a warning") } }
See for example https://codereview.qt-project.org/#/c/172758/
Attachments
Issue Links
- duplicates
-
QTBUG-47111 Add ignoreWarning that takes a RegExp
- Closed