Skip to content
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

Launch debug unit test with program cmake.launchTargetPath always run the same test #4147

Open
borjamunozf opened this issue Oct 29, 2024 · 3 comments
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: debug/launch more votes needed We currently are de-prioritizing this issue until more community up-votes are provided

Comments

@borjamunozf
Copy link

Brief Issue Summary

Hello. Probably this is by design, but given that we cant run the tests from side panel using cmake.testProgram (#3505) its 'the only way to support launch and debug a unit test.

Current config

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "(gdb) Launch Debug UnitTest",
      "type": "cppdbg",
      "request": "launch",
      "program": "${command:cmake.launchTargetPath}",
      "cwd": "${workspaceFolder}",
      "stopAtEntry": true,
      "externalConsole": false,
      "logging": {
        "trace": false
      },
      "environment": [
        {
          "name": "LD_LIBRARY_PATH",
          "value": "whateverasdasd"
        }
      ],
      "MIMode": "gdb",
      "setupCommands": [
        {
          "text": "-gdb-set auto-load safe-path /opt/",
          "description": "enable safe path",
          "ignoreFailures": false
        }
      ]
    },
  ],
  "inputs": [
    {
      "id": "whateverSysPath",
      "type": "command",
      "command": "shellCommand.execute",
      "args": {
        "command": "ls -d -1 /opt/whatever/*/*",
        "useSingleResult": true
      }
    },
  ]
}

We would like to get the list of available target unit test to run always we run this config. However, it only prompt the user once and then all subsequent executions run the same test, it does not even ask which target / unit test you would like to select.

The workaround is to go the side panel and click on the edit button...

Is there any way to force select or don't save the launch target path?

Image

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

@Amy-Li03
Copy link
Collaborator

Thank you for reporting this issue. We can reproduce this on our side, following is the repro video:
@gcampbell-msft is this by design?

Is there any way to force select or don't save the launch target path?

Also, do you have any suggestions for clients with the above issues?
Image

@Amy-Li03 Amy-Li03 added more info needed More info is needed from the community for us to properly triage and investigate. and removed triage labels Oct 30, 2024
@gcampbell-msft
Copy link
Collaborator

@borjamunozf To clarify, what you would like to see is for us to ask for the test that you want to launch every single time you invoke the launch.json entry?

You are correct that currently this is the design, so this is expected, however, if I'm understanding your request right, we can label this as a feature request.

Thanks

@borjamunozf
Copy link
Author

@borjamunozf To clarify, what you would like to see is for us to ask for the test that you want to launch every single time you invoke the launch.json entry?

You are correct that currently this is the design, so this is expected, however, if I'm understanding your request right, we can label this as a feature request.

Thanks

Yes, or at least have a way to ask always which test to run as target

@gcampbell-msft gcampbell-msft moved this from Blocked to Pending Prioritization in CMake Tools Nov 11, 2024
@gcampbell-msft gcampbell-msft added enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: debug/launch more votes needed We currently are de-prioritizing this issue until more community up-votes are provided and removed more info needed More info is needed from the community for us to properly triage and investigate. labels Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: debug/launch more votes needed We currently are de-prioritizing this issue until more community up-votes are provided
Projects
Status: Pending Prioritization
Development

No branches or pull requests

3 participants