vscode-cmake-tools
vscode-cmake-tools copied to clipboard
Don't force build to list tests
Brief Issue Summary
To list the tests the CMake tools forcibly build the project. It should be possible to list the tests without building them first for the following reasons:
- For very large projects it is not feasible to build the full project upfront if you just work on a subsets of targets and their tests
- Some of the tests might even not need to have any targets build
In other words it should to do the same with CMake tools as with command line CMake / ctest:
cmake --preset=my_default
# List tests:
ctest --preset=my_default -N
# Run helper test (does not need any compilation step):
ctest --preset=my_default -R helper
Steps to reproduce:
- Select configure preset
- Select test preset
- Now CMake tools automatically run a build
- Only after building its possible to see the list of tests
A simple CMake project to reproduce this issue is available in this github repo.
CMake Tools Diagnostics
{
"os": "linux",
"vscodeVersion": "1.82.2",
"cmtVersion": "1.15.31",
"configurations": [
{
"folder": "/home/gal/projekte/cmake_playground",
"cmakeVersion": "unknown",
"configured": false,
"generator": "unknown",
"usesPresets": false,
"compilers": {}
}
],
"cpptoolsIntegration": {
"isReady": false,
"hasCodeModel": false,
"activeBuildType": "",
"buildTypesSeen": [],
"requests": [],
"responses": [],
"partialMatches": [],
"targetCount": 0,
"executablesCount": 0,
"librariesCount": 0,
"targets": []
},
"settings": [
{
"communicationMode": "automatic",
"useCMakePresets": "auto",
"configureOnOpen": null
}
]
}
Debug Log
No response
Additional Information
No response
@sercxanto Thanks for the issue. I'm adding this to our list of ctest suggestions / issues.
@xisui-MSFT FYI.
@gcampbell-msft this issue seems to be a duplicate of #2933. Am i wrong?
Yes, I believe you are right, we should likely add a setting that controls whether we force a build before running ctest, similar to the cmake.buildBeforeRun setting. Closing this in favor of #2933