Skip to content

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

Open
@borjamunozf

Description

@borjamunozf

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature: debug/launchenhancementan enhancement to the product that is either not present or an improvement to an existing featuremore votes neededWe currently are de-prioritizing this issue until more community up-votes are provided

    Type

    No type

    Projects

    Status

    Pending Prioritization

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions