Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-99677 Extend baseline tests for all widgets and dialogs
  3. QTBUG-99790

force takeStandardSnapshots() to take all snapshots before launching QFAIL

    XMLWordPrintable

    Details

    • Type: Technical task
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Fixed
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      All

      Description

      Background:
      The method takeStandardSnapshots() in qwidgetbaselinetest.cpp is invoked by all widget baseline tests in tst_baseline_widgets.cpp.
      It retrieves a QWidget* from testWindow(), takes and compares 4 snapshots if the widget. The snapshots represent the following widget properties in the given order

      • default (newly created QWidget instance)
      • focused (setFocus() called on the widget's first child)
      • disabled (setEnabled(false) called on the widget)
      • inactive (other QWidget created and set active)

      Problem:
      When one of the above results in a mismatch (current rendering vs. baseline), the method returns with QFAIL and the other snapshots/comparisons are not done.

      Solution:
      Change takeStandardSnapshots() so that all 4 snapshots are taken, compared, logged and their results saved in a bool. QFAIL is launched afterwards, if one of the results is a mismatch.

      Implementation (to be discussed):
      To check the rendered image versus its baseline, takeStandardSnapshots() uses the macro QBASELINE_CHECK(image, name). It expands into QBASELINE_CHECK_SUM(image, name, sum).
      The macro performs determines if the check should be skipped due to blacklisting.
      If blacklisted, the test is skipped and logged accordingly.
      Unless blacklisted, the check is performed, logged and QFAIL is raised upon mismatch.

      A new macro QBASELINE_CHECK_DEFERRED(image, name, pass) will be defined.
      It creates a bool with the name given in pass on the current stack.
      The check will be performed and logged identically to QBASELINE_CHECK.
      Instead of raising QFAIL upon mismatch, the check result is stored in the bool.

      takeStandardSnapshots() will be modified to use the new macro QBASELINE_CHECK_DEFERRED. It will perform all 4 tests and perform QVERIFY afterwards on each of the bools representing the check results.

      Implication: As QBASELINE_CHECK_DEFERRED copies the logic of QBASELINE_CHECK, it may be more elegant to maintain the logic only QBASELINE_CHECK_DEFERRED and make QBASELINE_CHECK expand into it.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            axelspoerl Axel Spoerl
            Reporter:
            axelspoerl Axel Spoerl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes