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

Quick Test could only run a single TestCase object

    XMLWordPrintable

    Details

    • Platform/s:
      macOS

      Description

      A Quick Test project supports to run multiple TestCase declared in different QML file begin with tst_ prefix. Unfortunately, this feature was broken in Qt 5.12.0. It could only execute the first TestCase object. The rest are ignored. I have attached an example program to show the problem.

      The files in the project

      main.cpp
      qtbug.pro
      tst_Sample.qml
      tst_Sample2.qml

      Step to reproduce:

      qmake qtbug.pro 
      make
      ./qtbug
      

       Expected output (with Qt 5.11 or below):

      PASS : QuickTests::Sample::initTestCase()
      PASS : QuickTests::Sample::test_pass1()
      PASS : QuickTests::Sample::test_pass2()
      PASS : QuickTests::Sample::cleanupTestCase()
      PASS : QuickTests::Sample2::initTestCase()
      PASS : QuickTests::Sample2::test_pass()
      PASS : QuickTests::Sample2::cleanupTestCase()
      Totals: 7 passed, 0 failed, 0 skipped, 0 blacklisted, 128ms

      The Actual Output (with Qt 5.12):

      PASS : ::Sample::initTestCase()
      PASS : ::Sample::test_pass1()
      PASS : ::Sample::test_pass2()
      PASS : ::Sample::cleanupTestCase()
      Totals: 4 passed, 0 failed, 0 skipped, 0 blacklisted, 237ms

      A hotfix is to remove the `CONFIG+=qmltestcase` from the .pro file, but the Qt Creator will not be able to scan/execute tests on this project.

       

        Attachments

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

          Activity

            People

            • Assignee:
              qt.team.quick.subscriptions Qt Quick and Widgets Team
              Reporter:
              benlau Ben Lau
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes