Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-98718

Make qtdeclarative tests fail on warnings

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • None
    • None

      Now that https://codereview.qt-project.org/c/qt/qtbase/+/375915 is merged, we can start preventing new warnings from creeping into qtdeclarative.

      My proposal is to do this in tests that aren't based on QQmlDataTest:

      void QQmlDataTest::init()
      {
          QTest::failOnWarning(QRegularExpression(QStringLiteral(".?")));
      }
      

      and this in the constructor of those that are:

      // ...
       : QQmlDataTest(QT_QMLTEST_DATADIR, FailOnWarningsPolicy::FailOnWarnings)
      {
      }
      

      This would make every QQmlDataTest-based test function in qtdeclarative fail if a qWarning is encountered. It would require a bit of work up front: a few tests would probably require a bunch of QTest::ignoreMessages, and QTBUG-98439 would need to be fixed first.

      In addition, we should add a bool failOnWarnings to TestCase, defaulting it to the value of QT_QUICK_TEST_FAIL_ON_WARNINGS if it is set, otherwise false. This will allow us to enable it for all QML tests in the least disruptive way.

      This won't cover every test, but it's a good start.

        For Gerrit Dashboard: QTBUG-98718
        # Subject Branch Project Status CR V

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes