Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Questions about embedded test in Qt

    General and Desktop
    2
    7
    152
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Engelard
      Engelard last edited by Engelard

      Just started tests within Qt, read documentation, run few tests successfully, everything works. But i have few questions, hope there some people with experience of using Tests through Qt.

      1.) How to 'bind' tests with target project? I mean, my main project, and Tests - are independent projects, and i have to swap between them so often by clicking "set as primary object".
      2.) Got error: C1083: Cannot open include file: 'QMainWindow': No such file or directory after i tried to:

      #include "../TargetApplication/mywindow.h"

      I apparently did'nt add some command in my Test .pro, i'd say that problem arrives from #1.

      3.) Why there is no time counting in milliseconds for runned tests?) Or maybe it's just me, and my poor search skill.
      4.) Is it possible to make 'Test results' window float, so it could be moved independently on the screen. For example, would be useful to move it whole to the 2nd screen.

      P.S. i started with Google Tests(but i doubt that it matter in my case)

      jsulm 1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @Engelard last edited by

        @Engelard said in Questions about embedded test in Qt:

        Got error: C1083: Cannot open include file: 'QMainWindow': No such file or directory after i tried to

        How about adding "QT += widgets" to your test pro file?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        Engelard 1 Reply Last reply Reply Quote 0
        • Engelard
          Engelard @jsulm last edited by

          @jsulm no changes, error still exist(cleaned, and run qmake after adding that in .pro)

          jsulm 1 Reply Last reply Reply Quote 0
          • jsulm
            jsulm Lifetime Qt Champion @Engelard last edited by

            @Engelard Are you sure you cleared the test project?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            Engelard 1 Reply Last reply Reply Quote 0
            • Engelard
              Engelard @jsulm last edited by

              @jsulm even reloaded whole framework, still "no such file or dir" thing.

              Few warnings btw, maybe they will give the hint:

              Project WARNING: Using googletest src dir specified at Qt Creator wizard
              "D:\Program Files\VS19\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\cl.exe" is used by qmake, but "D:\Program Files\VS19\VC\Tools\MSVC\14.29.30037\bin\HostX64\x64\cl.exe" is configured in the kit.
              Please update your kit (Desktop Qt 5.12.0 MSVC2017 64bit) or choose a mkspec for qmake that matches your target environment better.

              1 Reply Last reply Reply Quote 0
              • Engelard
                Engelard last edited by Engelard

                Found. I was needed:

                greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                

                It worked for Qt Tests and Qt Quick Tests, still not working for Google Tests. I'm missing something, including other source files to the test is basic thing, it should'nt be such a problem...

                1 Reply Last reply Reply Quote 1
                • Engelard
                  Engelard last edited by

                  Found similar problem on this forum, it is unsolved as well. It is silly, first thing what user do when creating Tests - including path to product project, and Qt Creator does not allow that, nonsense...

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post