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

QTestLib does not skip test function if init() fails.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.0.0
    • 5.0.0
    • Testing: qtestlib
    • None
    • 64642a4d9768b767c51c7f92dec94f655ba60195

    Description

      In qt5, the file qtdoc/doc/src/development/qtestlib.qdoc states:

      "If \c

      {initTestCase()}

      fails, no testfunction will be executed. If \c

      {init()}

      fails,
      the following testfunction will not be executed, the test will proceed to the next
      testfunction."

      The first of these statements is true, but the second is false.

      If init() returns any result except SkipTestCase, the following test function will be executed – see the function qInvokeTestMethodDataEntry in qtestcase.cpp. To bail out on init() failing, each test function would have to examine the return value of currentTestFailed().

      This task must be resolved either by fixing qtestlib to match the documentation, or by amending the docs to describe the current behaviour.

      Attachments

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

        Activity

          People

            jasmcdon Jason McDonald (Closed Nokia Identity. Please assign to "macadder" instead) (Inactive)
            jasmcdon Jason McDonald (Closed Nokia Identity. Please assign to "macadder" instead) (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes