-
Notifications
You must be signed in to change notification settings - Fork 468
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
ctest -N does not work with custom cmake path from preset #2842
Comments
Can you try and run the command in the terminal and see if it works? |
In other words, are you able to run cmake with your test preset in the terminal without our extension? (e.g. |
I cannot run I use the {
"version": 5,
"cmakeMinimumRequired": {
"major": 3,
"minor": 23,
"patch": 0
},
"configurePresets": [
{
"name": "Release",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/Release",
"cmakeExecutable": "C:\\path\\to\\cmake\\cmake.exe",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
},
"environment": {
"PATH": "C:\\path\\to\\ninja;$penv{PATH}"
}
}
],
<...>
} If I change the preset to the following, the execution of the tests from Visual Studio Code is possible but {
"version": 5,
"cmakeMinimumRequired": {
"major": 3,
"minor": 23,
"patch": 0
},
"configurePresets": [
{
"name": "Release",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/Release",
"cmakeExecutable": "C:\\path\\to\\cmake\\cmake.exe",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
},
"environment": {
"PATH": "C:\\path\\to\\cmake;C:\\path\\to\\ninja;$penv{PATH}"
}
}
],
<...>
} |
Thank you for the extra information. I found the problem and will submit a fix soon. |
Brief Issue Summary
We have a custom CMake installation. The PATH environment variable is not configured and does not contain
cmake
orctest
.cmakeExecutable
inCMakePreset.json
is set correctly.Everything work, except for
ctest
:I could get the tests running by adding the CMake
bin
folder toenvironment.PATH
in the preset:However, determining the available tests using
ctest -N
still fails.I found a difference in code:
It looks like
ctestpath
is not detected correctly in both cases but due toenvironment: await driver.getCTestCommandEnvironment()
it still works if the preset environment contains cmake.CMake Tools Diagnostics
Debug Log
No response
Additional Information
I shorten some paths in the diagnostics output. I do not think they are relevant for the issue.
The text was updated successfully, but these errors were encountered: