Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Questions about embedded test in Qt

Questions about embedded test in Qt

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 428 Views
  • 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.
  • EngelardE Offline
    EngelardE Offline
    Engelard
    wrote on last edited by Engelard
    #1

    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)

    jsulmJ 1 Reply Last reply
    0
    • EngelardE 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)

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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

      EngelardE 1 Reply Last reply
      0
      • jsulmJ jsulm

        @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?

        EngelardE Offline
        EngelardE Offline
        Engelard
        wrote on last edited by
        #3

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

        jsulmJ 1 Reply Last reply
        0
        • EngelardE Engelard

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

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Engelard Are you sure you cleared the test project?

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

          EngelardE 1 Reply Last reply
          0
          • jsulmJ jsulm

            @Engelard Are you sure you cleared the test project?

            EngelardE Offline
            EngelardE Offline
            Engelard
            wrote on last edited by
            #5

            @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
            0
            • EngelardE Offline
              EngelardE Offline
              Engelard
              wrote on last edited by Engelard
              #6

              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
              1
              • EngelardE Offline
                EngelardE Offline
                Engelard
                wrote on last edited by
                #7

                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
                0
                • EngelardE Engelard has marked this topic as solved on

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved