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

QUICK_TEST_MAIN_WITH_SETUP setup object should expose the current qml file being tested

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Some future release
    • Testing: QuickTest
    • None
    • All

    Description

      QUICK_TEST_MAIN_WITH_SETUP allows one to provide a C++ class with methods that get called by the test. The `qmlEngineAvailable` method is called once for every test ran. Unfortunately, which test file is going to be ran is not exposed. That would be very useful information, in my case it would allow me to setup some mocking data differently. 

      The simplest way to expose it would be, I think, either adding another method that will be called before `qmlEngineAvailable` with the test case, or adding an overload called on `qmlEngineAvailable` that includes the test case path as an additional argument. 

      I currently need to rely on the actual implementation to track which file is being tested, which is of course not great as that's very much an implementation detail.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            andre André Somers
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes