You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Register cmake.testProgram, cmake.testWorkingDirectory, cmake.testArgs as VS Code commands
Fixes#4574 - The ${cmake.testProgram}, ${cmake.testWorkingDirectory}, and
${cmake.testArgs} variables were only resolved internally by CMake Tools when
debugging from the Test Explorer. They were not registered as VS Code commands,
so using ${command:cmake.testProgram} in launch.json from the Run and Debug
panel would fail with "program does not exist".
Changes:
- Make testProgram, testWorkingDirectory, testArgs public on CTestDriver
- Add corresponding methods to ExtensionManager with test name quick pick
- Register them in the funs array and package.json activation events
- Handle ${command:cmake.testProgram} form in debugCTestImpl for Test Explorer
- Update docs to recommend ${command:cmake.testProgram} format
- Add CHANGELOG entry
Co-authored-by: hanniavalera <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ Features:
7
7
8
8
Bug Fixes:
9
9
10
+
- Register `cmake.testProgram`, `cmake.testWorkingDirectory`, and `cmake.testArgs` as VS Code commands so they can be used as `${command:cmake.testProgram}` in launch.json from the Run and Debug panel. [#4574](https://github.com/microsoft/vscode-cmake-tools/issues/4574)
10
11
- Fix CMake script path links not working in CHS/CSY/FRA/PLK locales due to localized quotes. [#4383](https://github.com/microsoft/vscode-cmake-tools/issues/4383)
11
12
- Fix user-level tasks defined in `~/.config/Code/User/tasks.json` causing infinite spinner. [#4659](https://github.com/microsoft/vscode-cmake-tools/pull/4659)
12
13
- Fix "Copy Value" in CMake debugger copying variable name instead of value. [#4551](https://github.com/microsoft/vscode-cmake-tools/issues/4551)
Copy file name to clipboardExpand all lines: docs/debug-launch.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -213,8 +213,9 @@ You can substitute the value of any variable in the CMake cache by adding a `com
213
213
214
214
You can also construct launch.json configurations that allow you to debug tests in the Test Explorer.
215
215
216
-
> **Note:**
217
-
> These launch.json configurations are to be used specifically from the UI of the Test Explorer.
216
+
There are two forms of these variables:
217
+
-`${command:cmake.testProgram}`, `${command:cmake.testArgs}`, `${command:cmake.testWorkingDirectory}` — These are resolved as VS Code command substitutions and work both from the **Test Explorer** and the **Run and Debug** panel. When launched from Run and Debug, you will be prompted to select a test.
218
+
-`${cmake.testProgram}`, `${cmake.testArgs}`, `${cmake.testWorkingDirectory}` — These are only resolved when launching from the **Test Explorer** UI. If used from the Run and Debug panel, they will not be substituted.
218
219
219
220
The easiest way to do this is to construct the debug configuration using `cmake.testProgram` for the `program` field, `cmake.testArgs` for
220
221
the `args` field, and `cmake.testWorkingDirectory` for the `cwd` field.
0 commit comments