aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlformat
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2022-06-07 10:23:31 +0800
committerMitch Curtis <mitch.curtis@qt.io>2022-07-05 14:34:37 +0800
commit234afb5502ab20b4f58ddd9b01a4245330a7e5a4 (patch)
tree44f3bea37e8fd6abddf5f7d26095373c7dd0b44f /tests/auto/qml/qmlformat
parent7112b4e0cc9b7625288d0464c02d92390ab0f193 (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/qml/qmlformat')
-rw-r--r--tests/auto/qml/qmlformat/tst_qmlformat.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/qml/qmlformat/tst_qmlformat.cpp b/tests/auto/qml/qmlformat/tst_qmlformat.cpp
index adf63cb254..458a36fc54 100644
--- a/tests/auto/qml/qmlformat/tst_qmlformat.cpp
+++ b/tests/auto/qml/qmlformat/tst_qmlformat.cpp
@@ -55,8 +55,9 @@ private:
bool isInvalidFile(const QFileInfo &fileName) const;
};
+// Don't fail on warnings because we read a lot of QML files that might intentionally be malformed.
TestQmlformat::TestQmlformat()
- : QQmlDataTest(QT_QMLTEST_DATADIR)
+ : QQmlDataTest(QT_QMLTEST_DATADIR, FailOnWarningsPolicy::DoNotFailOnWarnings)
{
}