microsoft / microsoft/vscode-cmake-tools
ctest preset outputLogFile property handled differently between ctest and Visual Studio Code
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 546
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 32
Description
### Brief Issue Summary
The outputLogFile preset property seems to be interpreted differently when executing tests from the command line via ctest compared to executing from Visual Studio Code. In the latter case, it seems to be interpreted relative to CMAKE_BINARY_DIR while ctest handles it relative to the location of CMakePresets.json.
If, say, `CMAKE_BINARY_DIR ` is `out/build` and `outputLogFile` is `path/to/test_output.log`, then running ctest from the command line will write test output to `path/to/test_output.log` while Visual Studio Code will output to `out/build/path/to/test_output.log`.
### CMake Tools Diagnostics
```shell
"cmtVersion": "1.16.32",
"configurations": [
{
"folder": "my_project",
"cmakeVersion": "3.28.1",
"configured": true,
"generator": "Ninja",
"usesPresets": true,
"compilers": {
"C": "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe",
"CXX": "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe"
}
}
],
"cpptoolsIntegration": {
"isReady": true,
"hasCodeModel": true,
"activeBuildType": "Debug",
"buildTypesSeen": [
"Debug"
],
"requests": [],
"responses": [],
"partialMatches": [],
"targetCount": 8,
"executablesCount": 5,
"librariesCount": 3,
"targets": [
]
},
"settings": [
{
"communicationMode": "automatic",
"useCMakePresets": "auto",
"configureOnOpen": false
}
]
}
```
### Debug Log
_No response_
### Additional Information
_No response_
Contributor guide
Research direction
Start by tracing how CMake Tools handles the CMakePresets.json outputLogFile property when launching tests from VS Code, then compare that path handling with ctest. Use the reported out/build and path/to/test_output.log example to reproduce the discrepancy. Done means both execution paths resolve the property consistently, with regression coverage for the relative path behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, typescript
- Domain
- testing-qa, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100