Closed rafalborczuch closed 8 months ago
where is the ProjectA
coming from?
The above assumes that the directory structure is as follows:
repo
projectA
projectB
repo.code-workspace
and it is opened in the VS Code as a mutli-root workspace file repo.code-workspace
that has the following folders defined:
"folders": [
{
"path": "projectA"
},
{
"path": "projectB"
}
]
The build output binaries are placed under projectA/bin/linux/Debug
and projectB/bin/linux/Debug
and the "label": "${absDirpath[-4:-3]}",
results in projectA
or projectB
.
And what is the expectations for that label?
It's a but unclear what is the current value and what you expect.
Have you tried using ${relDirpath[0]}
?
${relDirpath[0]}
gives the same result.
The expected top level label is projectA
or projectB
.
The problem is here: https://github.com/matepek/vscode-catch2-test-adapter/blob/master/src/framework/AbstractExecutable.ts#L293
The this.shared.options
has cwd
which has different value for each executable (due to the advancedExecutable
config "cwd": "${relDirpath}/ctest_cwds/${filename}"
) resulting in different options hash value that is used to construct the id
.
The mergeByLabel
configuration works more like mergeByEnvAndCwd
.
is ${relDirpath}/ctest_cwds/${filename}
a directory or a file?
Thanks, I have successfully verified the fix.
Checklist
Describe the bug
Label merging stops working after adding
cwd
property to the advanced executables configuration. Thecwd
path exists on the filesystem and tests have the correct cwd set when running/debugging. I use a multi-root workspace.To Reproduce
The following config correctly merges the labels in the tree view. Note that the
cwd
property is commented.producing the following tree view in the Test Explorer:
After uncommenting the
cwd
line:tree view in the Test Explorer doesn't merge 1st level label:
Each executable has its own 1st level node (
projectA
in the example).Desktop