We need a walkthrough for setting up QtTest unit tests in Visual Studio
-
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!
-
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!
Since cmake and make can generate Visual Studio projects where exactly is the problem? There is also the visual studio qt plugin.
-
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!
@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.