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

Mixing TestCases with and without "when: windowShown" in one file skips TestCases or hangs

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.5.0
    • Testing: QuickTest
    • None
    • Tested on OS X 10.11.2
    • macOS

    Description

      Given "tst_FirstTest.qml":

      import QtQuick 2.5
      import QtTest 1.1
      
      Item {
          implicitWidth: 124
          implicitHeight: 116
      
          TestCase {
              name: "C"
              function test_3() {}
          }
      
          TestCase {
              name: "B"
              when: windowShown
              function test_2() {}
          }
      
          TestCase {
              name: "A"
              function test_1() {}
          }
      }
      

      If run with qmltestrunner, it'll skip TestCase B:

      PASS   : qmltestrunner::A::initTestCase()
      PASS   : qmltestrunner::A::test_1()
      PASS   : qmltestrunner::A::cleanupTestCase()
      PASS   : qmltestrunner::C::initTestCase()
      PASS   : qmltestrunner::C::test_3()
      PASS   : qmltestrunner::C::cleanupTestCase()
      

      Setting all or none TestCase(s) to "when: windowShown" is fine.

      If another test file is run after this one, TestCase B hangs. To reproduce save the attached files and run qmltestrunner on their folder.

      One workaround would be to not have more than one TestCase in one file, but the documentation explicitly states that "Multiple TestCase types can be supplied.".

      Attachments

        1. tst_FirstTest.qml
          0.3 kB
        2. tst_SecondTest.qml
          0.1 kB
        For Gerrit Dashboard: QTBUG-50514
        # Subject Branch Project Status CR V

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mlitauer Martin Litauer
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes