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

Qt Quick Test: Optional TestCase can wait indefinitely if "when: false" is applied

XMLWordPrintable

      Code

      import QtQuick
      import QtTest
      
      Item {
          TestCase {
              name: "MyMandatoryTest"
              when: true
              optional: false
      
              function test_mandatory() {
                  compare(1 + 1, 2, "sanity check");
                  verify(true);
              }
          }
      
          TestCase {
              name: "MyOptionalTest"
              when: false
              optional: true
      
              function test_optional() {
                  compare(1 + 1, 2, "sanity check");
                  verify(true);
              }
          }
      }
      

       

      Steps to reproduce

      1. Run the attached project
      2. Comment out the TestCase "MyMandatoryTest" and re-run the project.

       

      Outcomes

      • Step #1: MyMandatoryTest is initialized + run + cleaned up while MyOptionalTest has no activity at all (Expected)
      • Step #2: MyOptionalTest has no activity at all (Expected), but the empty window stays open indefinitely and closing the window leaves a zombie process (Not Expected)

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

            mitch_curtis Mitch Curtis
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change