Skip to content

Commit f30867b

Browse files
add test
1 parent 91777e3 commit f30867b

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/presetsController.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,6 +1610,7 @@ export class PresetsController implements vscode.Disposable {
16101610
if (this.presetsFileExist && file === this.userPresetsPath) {
16111611
presetsFile.include = presetsFile.include || [];
16121612
const filteredIncludes = presetsFile.include.filter(include => {
1613+
// Ensuring that we handle expansions. Duplicated from loop below.
16131614
const includePath = presetsFile.version >= 7 ?
16141615
// Version 7 and later support $penv{} expansions in include paths
16151616
substituteAll(include, getParentEnvSubstitutions(include, new Map<string, string>())).result :

test/extension-tests/single-root-UI/project-folder/CMakeUserPresets.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
"environment": {
4545
"TEST_VARIANT_ENV": "0cbfb6ae-f2ec-4017-8ded-89df8759c502"
4646
}
47+
},
48+
{
49+
"name": "TestInheritFromPreset",
50+
"inherits": "Linux1"
4751
}
4852
]
49-
}
53+
}

test/extension-tests/single-root-UI/test/include-presets.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,9 @@ suite('Preset include functionality', () => {
6969
const result = await testEnv.result.getResultAsJson();
7070
expect(result['cookie']).to.eq('passed-cookie');
7171
}).timeout(100000);
72+
73+
test('Configure CMakeUserPreset inheriting from CMakePreset', async function (this: Mocha.Context) {
74+
await vscode.commands.executeCommand('cmake.setConfigurePreset', 'TestInheritFromPreset');
75+
expect(await vscode.commands.executeCommand('cmake.showConfigureCommand')).to.be.eq(0);
76+
}).timeout(100000);
7277
});

0 commit comments

Comments
 (0)