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

The snippet in "Separating Tests from Application Logic" leads to an error

    XMLWordPrintable

Details

    • Windows
    • 286ee6173 (dev), 6179cf9d6 (6.8)
    • DaVinci 104

    Description

      Documentation link: https://doc.qt.io/qt-6/qml-qttest-testcase.html#separating-tests-from-application-logic

       

      <Issue>

      Following the provided snippet in the documentation leads to an error.

      *Workaround would be highly appreciated if fixing this takes time.

      <Reproduction Steps>

      1. Clone https://git.qt.io/mikio_hirai/qtquicktest_test (fa030f6e)
      2. Open the TestApp/CMakeLists.txt with Qt Creator
      3. Configure the project
      4. Build and execute "TestMyApplication"

      <Expected result>

      Test runs and passes.

      <Actual result>
      Test fails with this error.

      17:30:42: C:\Users\81808\Downloads\TestApp\build\Desktop_Qt_6_7_1_MSVC2019_64bit-Debug\TestMyApplication.exe を起動中...
      QML debugging is enabled. Only use this in a safe environment.
      ********* Start testing of example *********
      Config: Using QtTest library 6.7.1, Qt 6.7.1 (x86_64-little_endian-llp64 shared (dynamic) debug build; by MSVC 2019), windows 11
      QWARN  : example::tst_testmyapplication::compile() 
        C:\Users\81808\Downloads\TestApp\test\tst_testmyapplication.qml produced 1 error(s):
          C:\Users\81808\Downloads\TestApp\test\tst_testmyapplication.qml:5,1: module "MyModule" plugin "MyModuleplugin" not found
        Working directory: C:\Users\81808\Downloads\TestApp\build\Desktop_Qt_6_7_1_MSVC2019_64bit-Debug
        Import paths:
          'C:\Users\81808\Downloads\TestApp\build\Desktop_Qt_6_7_1_MSVC2019_64bit-Debug'
          'qrc:\qt-project.org\imports'
          'qrc:\qt\qml'
          'C:\Users\81808\squishcoco\cocoqml-5.1.0-windows\build'
          'C:\Qt\6.7.1\msvc2019_64\qml'
        Plugin paths:
          '.'FAIL!  : example::tst_testmyapplication::compile() module "MyModule" plugin "MyModuleplugin" not found
      C:\Users\81808\Downloads\TestApp\test\tst_testmyapplication.qml(5) : failure location
      Totals: 0 passed, 1 failed, 0 skipped, 0 blacklisted, 3ms
      ********* Finished testing of example *********
      17:30:42: C:\Users\81808\Downloads\TestApp\build\Desktop_Qt_6_7_1_MSVC2019_64bit-Debug\TestMyApplication.exe は終了コード 1 で終了しました 

       

      Attachments

        Issue Links

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

          Activity

            People

              andreas.eliasson Andreas Eliasson
              mikio_hirai Mikio Hirai
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes