diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2022-06-07 10:23:31 +0800 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2022-07-05 14:34:37 +0800 |
commit | 234afb5502ab20b4f58ddd9b01a4245330a7e5a4 (patch) | |
tree | 44f3bea37e8fd6abddf5f7d26095373c7dd0b44f /tests/auto/quick/qquicklistview/tst_qquicklistview.cpp | |
parent | 7112b4e0cc9b7625288d0464c02d92390ab0f193 (diff) |
Add convenience API for making QQmlDataTest-based tests fail on warnings
After this patch, if a QQmlDataTest-derived class passes
FailOnWarningsPolicy::FailOnWarnings to the base constructor, any
non-empty warning encountered by that test will result in a test
failure.
This avoids the need to duplicate the catch-all regex in tests that
want to fail on warnings.
The goal is to gradually enable failure-on-warnings over time.
Leave comments and explicitly pass DoNotFailOnWarnings for tests that
should never fail on warnings.
Task-number: QTBUG-98718
Pick-to: 6.2 6.3 6.4
Change-Id: I4b647d93a0f28ac891c4bdb19ef74569f2918e8f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/quick/qquicklistview/tst_qquicklistview.cpp')
-rw-r--r-- | tests/auto/quick/qquicklistview/tst_qquicklistview.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index b900368847..e6cb4d53db 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -54,7 +54,7 @@ public: private slots: // WARNING: please add new tests to tst_qquicklistview2; this file is too slow to work with. - void init(); + void init() override; void cleanupTestCase(); // Test QAbstractItemModel model types void qAbstractItemModel_package_items(); @@ -387,6 +387,8 @@ tst_QQuickListView::tst_QQuickListView() void tst_QQuickListView::init() { + QQmlDataTest::init(); + #ifdef SHARE_VIEWS if (m_view && QString(QTest::currentTestFunction()) != testForView) { testForView = QString(); |