vscode-cmake-tools
vscode-cmake-tools copied to clipboard
Allow test debugging without a launch configuration
Brief Issue Summary
When I press on the Debug play button on a test in the Testing tab, it says in the output window:
[ctest] No launch configurations found.
Why do I need to provide a launch configuration when I want to debug a test? I can run the test, and debug the main target without any launch configuration.
The same should apply when debugging a test.
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response
@quyykk Thanks for the suggestion! Marking it a feature request and putting it on the backlog to try and assess when/if we can fit this work in! Thanks again.
@gcampbell-msft Seems like this feature (debugging a test) is actually broken.
I added a launch configuration to workaround and tried to debug a test, but instead of the test being launched with a debugger attached, it started my main application with a debugger. I'm assuming it uses my launch configuration? which is wrong
This issue should probably be reprioritized I think :smile:
@xisui-MSFT can you comment on how this scenario is supposed to work?
This is by design. VS Code requires a launch config in order to debug anything. CMake tools doesn't depend on extensions that provide debug adapters and so it's not appropriate to have a default one that uses "cppdbg" or something alike.
As for usage, @gcampbell-msft I remember you wrote a doc on creating a launch config for debugging tests?
so it's not appropriate to have a default one that uses "cppdbg" or something alike.
This extension already uses cppdbg for Quick Debugging, so I don't really see the issue.
I'm pretty sure Quick Debugging is added after this, so the original design is also fine. However, since it's decided that this extension now have a higher level of dependency on cpptools, it's OK to add some default launch options. @benmcmorran
+1
I am confused as well. I could set up the cmake build with gtest and let tests run with TestMate.
So why does running a test work out of the box, but debugging requires a "configuration"?
Furthermore, when I search about VSCode and debugging, it is said that in the launch.json file, one must give the path to the executable. But isn't selecting the executable job of the test runner, because there are many executables???
(Sorry, maybe I am spoiled from other IDEs, but why all that setting up stuff? Isn't this why there are extensions made for?)
Or just make it easy to generate a boilerplate launch configuration.