Open fuchse-ego opened 1 year ago
Hi,
thanks for letting me know. I am sorry that I cannot investigate at the moment. I will look into it as soon as possible.
@fuchse-ego Did you make it work with multiroot?
After I specified the settings in the workspace settings, the testexplorer find the tests but add one "Main Suite" for each folder in Workspace. For me this will work at the Moment
{
"folders": [
{
"path": "CMake",
"name": "Testrunner (local)"
},
{
"path": "Core"
},
{
"path": "Tests"
}
],
"settings": {
"todo-tree.tree.scanMode": "workspace only",
"cmake.autoSelectActiveFolder": false,
"cpputestTestAdapter.logpanel": true,
"cpputestTestAdapter.testExecutable": "${workspaceFolder}/build/testrunner.exe",
"cpputestTestAdapter.testExecutablePath": "${workspaceFolder}/build/",
"testExplorer.hideWhen": "noAdapters",
"testExplorer.useNativeTesting": false,
}
}
Hi @nische, thanks for this example. I also got it to work. However, as you mentioned, it duplicates all testes in as many "Main Suits" as you have workspace folders:
Seems the bug here is that the test adapter only finds the test if specified in the workspace settings. It does not respect the individual .vscode/settings.json files in the workspace folders and the settings there.
Edit: I noticed that it only works, if the UnitTest folders is the first one in your workspace configuration. I'm no Java/TypeScript guy, but this line (main.ts#L8) seems suspicious:
const workspaceFolder = (vscode.workspace.workspaceFolders || [])[0];`
Nice find. Yes that line is very much suspicious and now that I read I can remember that I had some issues with that as well. From the back of my head I'd say it was due to the old extension. But since I am using the "new" test api anyways I think it is fixable
I am currently over it and I am actually confused how you would set the test executable for multiple workspace because the setting itself only exists once. Best approach would be to add them all as a list and let the extension figure out which one exists. But then again, if you use {workspace} which one is it?
To answer my own question: VSCode got you all covered, there is a folder setting as well. I will use that to let you configure the specific workspace testrunners:
Hi,
I'm using this extension in a single folder workspace and it's great!
However I experimented with the new Multi-root Workspaces and found that the test are not listed correctly. The tests will show up as "Main Suite" with no child nodes.
Steps to reproduce:
Unfortunately. I'm no JavaScript/TypeScript guy, so I cannot help you out with a PR :(