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. We need a walkthrough for setting up QtTest unit tests in Visual Studio
Forum Updated to NodeBB v4.3 + New Features

We need a walkthrough for setting up QtTest unit tests in Visual Studio

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 474 Views 1 Watching
  • 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.
  • G Offline
    G Offline
    GuitarMan
    wrote on last edited by
    #1

    I see plenty of tutorials that show how to set up unit tests with QtTest using CMake/QMake, but I am at a loss as to how to set this up using the Project Settings in visual studio. I've spent the entire day searching the web and this forum and nothing. There are a couple threads on stack exchange that offered some ideas, but I couldn't get any of them to work. Grrr, it shouldn't be this difficult!

    Christian EhrlicherC S 2 Replies Last reply
    0
    • G GuitarMan

      I see plenty of tutorials that show how to set up unit tests with QtTest using CMake/QMake, but I am at a loss as to how to set this up using the Project Settings in visual studio. I've spent the entire day searching the web and this forum and nothing. There are a couple threads on stack exchange that offered some ideas, but I couldn't get any of them to work. Grrr, it shouldn't be this difficult!

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Since cmake and make can generate Visual Studio projects where exactly is the problem? There is also the visual studio qt plugin.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • G GuitarMan

        I see plenty of tutorials that show how to set up unit tests with QtTest using CMake/QMake, but I am at a loss as to how to set this up using the Project Settings in visual studio. I've spent the entire day searching the web and this forum and nothing. There are a couple threads on stack exchange that offered some ideas, but I couldn't get any of them to work. Grrr, it shouldn't be this difficult!

        S Offline
        S Offline
        SimonSchroeder
        wrote on last edited by
        #3

        @GuitarMan said in We need a walkthrough for setting up QtTest unit tests in Visual Studio:

        Grrr, it shouldn't be this difficult!

        Qt's main advantage is to write portable software. This is why there is a focus on project configurations that are portable between platforms. VS projects isn't one of them. In my opinion, there is not good integration with VS. The best we figured out to do is to use a QMake-based project and let qmake generate a VS project file. The resulting VS project is already much better than Qt's Visual Studio plugin. CMake would be even easier to use with VS, as it would be supported natively.

        The best way to figure out how to add tests to a VS project is to create a dummy QMake project with one test and generate the corresponding VS project from this. Have a look at the created project file with a text editor (it is XML after all) and see if you can reproduce everything from within VS.

        1 Reply Last reply
        1

        • Login

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