-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify debug configuration for ctest debug launch #3153
Comments
i'll explain that confuse issue over there. When using TestMate c++ this extension provide a debug configuration that work by default without writing a new one in launch.json. The new cmake tools ask for a launch configuration when try to use a debugger, but after days of searching i did not encounter any tutorial that provide a way to , for example, pass the name of the selected test to the args in launch.json, this mean that also if i selected a test, all tests will be launched. If there is a way to pass such argument, this information should be provided by the extension itself or by a default launch.json configuration that indicate the presence of this argument. |
@IlVirtuoso Can you provide the launch.json you are using? |
@IlVirtuoso Does the launch.json under If not, does a launch.json that looks similar to the following:
allow you to then debug tests from the Test Explorer? |
@IlVirtuoso Following up on this, does the above launch.json work for you? Thanks |
@gcampbell-msft Sorry i saw the message just now, my previous json was that {
"name": "LaunchTest",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/DistributedCrack_test",
"args": [
"--gtest_filter= ${relativeFile} "
],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Abilita la riformattazione per gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Imposta Versione Disassembly su Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
}, i tried to catch the name of the entry and filter it in relativeFile with a custom action, but it failed. Trying to launch the .json you provide (in debug obliviously) i obtain the error launch property 'cwd' is missing. |
If you provide the same |
@IlVirtuoso Are you using the test explorer? If so, my suggestion is to start debugging the test you want to debug in the test explorer. The main advantage is, using this method, If you are not using the test explorer, you'll need to make sure the program and args match the test item you would like to debug. Either way, you'll need to double check that fields like |
after following @xisui-MSFT instructions to add This is worse when I click the |
@diablodale I'm glad you're able to ctest debug individual tests! Thanks for your feedback regarding the usage of the Test Explorer, we will continue to use your feedback into consideration as we plan our backlog and plan for future features and work items. @xisui-MSFT FYI |
This seems to be the same issue as #3345 |
Brief Issue Summary
it's not clear how to write a configuration in launch.json that can debug a single test, since the default configuration launch all tests.
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: