This extension allows VSCode to know about Qt Tests. QtTestLib tests will appear in the side bar, under "Testing".
The test slots are also exposed and can be run individually.
GTests are also listed, but their individual "slots" are not exposed.
Only CMake based projects are supported at this time. The cmake extension is used to determine
the build directory and ctest is invoked to list the available tests, which were added with add_test().
- Listing and running Qt tests
- Listing and running individual QTest test slots
- Context-menu entry to run selected slot in the text editor
-
KDAB.QtTest.debuggerBy default the extension will try to guess what's the best debugger. But you can and probably should explicitly chose which debugger to use. The best setting might beExisting Launch, which will use an existing launch config, this way you can reuse your source maps, pretty printers and launch env variables. When reusing an existing launch, its program and args are replaced by the test you're running. -
KDAB.QtTest.CheckTestLinksToQtTestLibOnly available on Linux. Turn it on in case you have non-Qt tests executables that you want to exclude from the list. Patches accepted for Windows and macOS support.
In the output pane, chose KDAB-QtTest and see if there are any errors.
Before reporting a bug, clear the output pane, reproduce the bug, and copy all output, paste it in the bug report.
Try pressing the reload button if list of tests seem stale.
If no tests are reported, try running ctest -N inside the build directory. If that doesn't work either then it's a cmake problem.
Either there's really no tests added with add_test() or the enable_testing() call is missing in the root CMakeLists.txt.
This extension is supported and maintained by Klarälvdalens Datakonsult AB (KDAB).
The KDAB Group is the global No.1 software consultancy for Qt, C++ and OpenGL applications across desktop, embedded and mobile platforms.
The KDAB Group provides consulting and mentoring for developing Qt applications from scratch and in porting from all popular and legacy frameworks to Qt. We continue to help develop parts of Qt and are one of the major contributors to the Qt Project. We can give advanced or standard trainings anywhere around the globe on Qt as well as C++, OpenGL, 3D and more.
Please visit https://www.kdab.com to meet the people who write code like this.
Stay up-to-date with KDAB product announcements: