Skip to content

Commit 6a74b18

Browse files
committed
Merge branch 'main' into issue-4404-utility-target-shadowing
2 parents efe3e93 + 024d14d commit 6a74b18

File tree

13 files changed

+75
-20
lines changed

13 files changed

+75
-20
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"settings": {
1010
"terminal.integrated.shell.linux": "/bin/bash"
1111
},
12-
"extensions": [
12+
"extensions": [true][
1313
"ms-vscode.cpptools"
1414
]
15-
}
15+
}

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,21 @@ Features:
1111

1212
Improvements:
1313

14+
- Add name de-mangling for C++ symbols in the Test Explorer view when running tests with coverage. [#4340](https://github.com/microsoft/vscode-cmake-tools/pull/4340) [@rjaegers](https://github.com/rjaegers)
1415
- No longer convert paths on lowercase on MacOS to enable cpp tools to resolve them. [#4325](https://github.com/microsoft/vscode-cmake-tools/pull/4325) [@tringenbach](https://github.com/tringenbach)
1516

1617
Bug Fixes:
1718

1819
- Fix bug that makes `Configure Task` lists only first folder in workspace. [#3232](https//github.com/microsoft/vscode-cmake-tools/issues/3232)
19-
- Fix displaying "Go to Test" in the Test Explorer when the DEF_SOURCE_LINE property is set, but there is no backtrace information present. [4321](https://github.com/microsoft/vscode-cmake-tools/pull/4321) [@rjaegers](https://github.com/rjaegers)
20+
- Fix displaying "Go to Test" in the Test Explorer when the DEF_SOURCE_LINE property is set, but there is no backtrace information present. [#4321](https://github.com/microsoft/vscode-cmake-tools/pull/4321) [@rjaegers](https://github.com/rjaegers)
2021
- Fix gnuld error parsing false positive on make errors, false negative due to trailing \r, and false parsing of new "multiple definitions" error [#2864](https://github.com/microsoft/vscode-cmake-tools/issues/2864) [@0xemgy](https://github.com/0xemgy)
2122
- Fixes for small bug string bugs. [#4319](https://github.com/microsoft/vscode-cmake-tools/issues/4319), [#4317](https://github.com/microsoft/vscode-cmake-tools/issues/4317), [#4312](https://github.com/microsoft/vscode-cmake-tools/issues/4312)
2223
- Fixes localization for "workspace is" string. [#4374](https://github.com/microsoft/vscode-cmake-tools/issues/4374)
2324
- Make tooltips for selecting Launch/Debug Target. [#4373](https://github.com/microsoft/vscode-cmake-tools/issues/4373)
2425
- Fix bug where unrelated symlinks are read as variant files [#4304](https://github.com/microsoft/vscode-cmake-tools/issues/4304) [@vitorramos](https://github.com/vitorramos).
2526
- Fix evaluation of conditions in presets. [#4425](https://github.com/microsoft/vscode-cmake-tools/issues/4425)
27+
- Fix ENOENT error at vscode startup on some circumstances [#2855](https://github.com/microsoft/vscode-cmake-tools/issues/2855) Contributed by STMicroelectronics
28+
- Fix repeat execution option in test presets [#4443](https://github.com/microsoft/vscode-cmake-tools/issues/4443)
2629
- Fix incorrect IntelliSense configuration when a `UTILITY` has source files. [#4404](https://github.com/microsoft/vscode-cmake-tools/issues/4404)
2730

2831
## 1.20.53

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2264,6 +2264,12 @@
22642264
"markdownDescription": "%cmake-tools.configuration.cmake.ctest.testSuiteDelimiter.markdownDescription%",
22652265
"scope": "machine-overridable"
22662266
},
2267+
"cmake.ctest.testSuiteDelimiterMaxOccurrence": {
2268+
"type": "number",
2269+
"default": 0,
2270+
"markdownDescription": "%cmake-tools.configuration.cmake.ctest.testSuiteDelimiterMaxOccurrence.markdownDescription%",
2271+
"scope": "machine-overridable"
2272+
},
22672273
"cmake.ctest.debugLaunchTarget": {
22682274
"type": "string",
22692275
"default": null,
@@ -3784,6 +3790,7 @@
37843790
"@types/chai": "^4.2.15",
37853791
"@types/chai-as-promised": "^7.1.3",
37863792
"@types/chai-string": "^1.4.2",
3793+
"@types/demangler-js": "^0.1.0",
37873794
"@types/js-yaml": "^4.0.0",
37883795
"@types/json5": "~0.0.30",
37893796
"@types/lodash": "4.14.202",
@@ -3834,10 +3841,11 @@
38343841
"webpack-cli": "^4.5.0"
38353842
},
38363843
"dependencies": {
3837-
"@friedemannsommer/lcov-parser": "^4.0.1",
3844+
"@friedemannsommer/lcov-parser": "^5.0.0",
38383845
"@types/string.prototype.matchall": "^4.0.4",
38393846
"ajv": "^7.1.0",
38403847
"chokidar": "^3.5.1",
3848+
"demangler-js": "^0.1.7",
38413849
"handlebars": "^4.7.7",
38423850
"iconv-lite": "^0.6.2",
38433851
"js-yaml": "^4.0.0",

package.nls.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@
127127
"Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered."
128128
]
129129
},
130+
"cmake-tools.configuration.cmake.ctest.testSuiteDelimiterMaxOccurrence.markdownDescription": {
131+
"message": "Maximum number of times the delimiter may be used to split the name of the test. `0` means no limit."
132+
},
130133
"cmake-tools.configuration.cmake.ctest.debugLaunchTarget.description": "Target name from launch.json to start when debugging a test with CTest. By default and in case of a non-existing target, this will show a picker with all available targets.",
131134
"cmake-tools.configuration.cmake.parseBuildDiagnostics.description": "Parse compiler output for warnings and errors.",
132135
"cmake-tools.configuration.cmake.enabledOutputParsers.description": {

src/cmakeExecutable.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as util from '@cmt/util';
33
import {setContextAndStore} from '@cmt/extension';
44
import * as logging from '@cmt/logging';
55
import * as nls from 'vscode-nls';
6+
import { ConfigurationReader } from './config';
67

78
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
89
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -24,7 +25,7 @@ export interface CMakeExecutable {
2425

2526
const cmakeInfo = new Map<string, CMakeExecutable>();
2627

27-
export async function getCMakeExecutableInformation(path: string): Promise<CMakeExecutable> {
28+
export async function getCMakeExecutableInformation(path: string, config?: ConfigurationReader): Promise<CMakeExecutable> {
2829
const cmake: CMakeExecutable = {
2930
path,
3031
isPresent: false,
@@ -50,7 +51,7 @@ export async function getCMakeExecutableInformation(path: string): Promise<CMake
5051
}
5152

5253
try {
53-
const execOpt: proc.ExecutionOptions = { showOutputOnError: true };
54+
const execOpt: proc.ExecutionOptions = { showOutputOnError: true, environment: config?.environment };
5455
const execVersion = await proc.execute(path, ['--version'], null, execOpt).result;
5556
if (execVersion.retc === 0 && execVersion.stdout) {
5657
console.assert(execVersion.stdout);

src/config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export interface ExtensionConfigurationSettings {
174174
buildToolArgs: string[];
175175
parallelJobs: number;
176176
ctestPath: string;
177-
ctest: { parallelJobs: number; allowParallelJobs: boolean; testExplorerIntegrationEnabled: boolean; testSuiteDelimiter: string; debugLaunchTarget: string | null };
177+
ctest: { parallelJobs: number; allowParallelJobs: boolean; testExplorerIntegrationEnabled: boolean; testSuiteDelimiter: string; testSuiteDelimiterMaxOccurrence: number; debugLaunchTarget: string | null };
178178
parseBuildDiagnostics: boolean;
179179
enabledOutputParsers: string[];
180180
debugConfig: CppDebugConfiguration;
@@ -394,6 +394,9 @@ export class ConfigurationReader implements vscode.Disposable {
394394
get testSuiteDelimiter(): string {
395395
return this.configData.ctest.testSuiteDelimiter;
396396
}
397+
get testSuiteDelimiterMaxOccurrence(): number {
398+
return this.configData.ctest.testSuiteDelimiterMaxOccurrence;
399+
}
397400
get ctestDebugLaunchTarget(): string | null {
398401
return this.configData.ctest.debugLaunchTarget;
399402
}
@@ -621,7 +624,7 @@ export class ConfigurationReader implements vscode.Disposable {
621624
parallelJobs: new vscode.EventEmitter<number>(),
622625
ctestPath: new vscode.EventEmitter<string>(),
623626
cpackPath: new vscode.EventEmitter<string>(),
624-
ctest: new vscode.EventEmitter<{ parallelJobs: number; allowParallelJobs: boolean; testExplorerIntegrationEnabled: boolean; testSuiteDelimiter: string; debugLaunchTarget: string | null }>(),
627+
ctest: new vscode.EventEmitter<{ parallelJobs: number; allowParallelJobs: boolean; testExplorerIntegrationEnabled: boolean; testSuiteDelimiter: string; testSuiteDelimiterMaxOccurrence: number; debugLaunchTarget: string | null }>(),
625628
parseBuildDiagnostics: new vscode.EventEmitter<boolean>(),
626629
enabledOutputParsers: new vscode.EventEmitter<string[]>(),
627630
debugConfig: new vscode.EventEmitter<CppDebugConfiguration>(),

src/coverage.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import * as vscode from 'vscode';
2-
import { lcovParser } from "@friedemannsommer/lcov-parser";
32
import * as nls from 'vscode-nls';
43
import * as logging from '@cmt/logging';
4+
import { demangle } from 'demangler-js';
55
import { platformNormalizePath } from './util';
66

7+
const { lcovParser } = require("@friedemannsommer/lcov-parser");
8+
79
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
810
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
911

@@ -61,7 +63,8 @@ export async function handleCoverageInfoFiles(run: vscode.TestRun, coverageInfoF
6163

6264
const declarations: vscode.DeclarationCoverage[] = [];
6365
for (const declaration of section.functions.details) {
64-
declarations.push(new vscode.DeclarationCoverage(declaration.name, declaration.hit,
66+
const demangledName = demangle(declaration.name);
67+
declarations.push(new vscode.DeclarationCoverage(demangledName, declaration.hit,
6568
new vscode.Position(declaration.line - 1, 0)));
6669
}
6770

src/ctest.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,10 +694,30 @@ export class CTestDriver implements vscode.Disposable {
694694
let parentSuiteItem = testExplorerRoot;
695695
let testLabel = testName;
696696

697+
function limited_split(regexString: string, subject: string, maxCount: number): string[] {
698+
if (maxCount === 0) {
699+
maxCount = Number.MAX_SAFE_INTEGER;
700+
}
701+
const delimiterRegExp = new RegExp(regexString, 'dg');
702+
const parts = [];
703+
let lastStart = 0;
704+
while (parts.length < maxCount) {
705+
const match: any = delimiterRegExp.exec(subject);
706+
if (match === null || match.indices === null) {
707+
break;
708+
}
709+
710+
parts.push(subject.substring(lastStart, match.indices[0][0]));
711+
lastStart = match.indices[0][1];
712+
}
713+
714+
parts.push(subject.substring(lastStart));
715+
return parts;
716+
}
717+
697718
// If a suite delimiter is set, create a suite tree
698719
if (this.ws.config.testSuiteDelimiter) {
699-
const delimiterRegExp = new RegExp(this.ws.config.testSuiteDelimiter);
700-
const parts = testName.split(delimiterRegExp);
720+
const parts = limited_split(this.ws.config.testSuiteDelimiter, testName, this.ws.config.testSuiteDelimiterMaxOccurrence);
701721
testLabel = parts.pop() || testName; // The last part is the test label
702722

703723
// Create a suite item for each suite ID part if it doesn't exist yet at that tree level

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export class ExtensionManager implements vscode.Disposable {
146146
cmakePath = await workspaceContext.getCMakePath() || '';
147147
}
148148
// initialize the state of the cmake exe
149-
await getCMakeExecutableInformation(cmakePath);
149+
await getCMakeExecutableInformation(cmakePath, this.workspaceConfig);
150150

151151
await util.setContextValue("cmake:testExplorerIntegrationEnabled", this.workspaceConfig.testExplorerIntegrationEnabled);
152152
this.workspaceConfig.onChange("ctest", async (value) => {

src/presets/preset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2391,7 +2391,7 @@ export function testArgs(preset: TestPreset): string[] {
23912391
preset.execution.resourceSpecFile && result.push('--resource-spec-file', preset.execution.resourceSpecFile);
23922392
preset.execution.testLoad && result.push('--test-load', preset.execution.testLoad.toString());
23932393
preset.execution.showOnly && result.push('--show-only', preset.execution.showOnly);
2394-
preset.execution.repeat && result.push(`--repeat ${preset.execution.repeat.mode}:${preset.execution.repeat.count}`);
2394+
preset.execution.repeat && result.push('--repeat', `${preset.execution.repeat.mode}:${preset.execution.repeat.count}`);
23952395
preset.execution.interactiveDebugging && result.push('--interactive-debug-mode 1');
23962396
preset.execution.interactiveDebugging === false && result.push('--interactive-debug-mode 0');
23972397
preset.execution.scheduleRandom && result.push('--schedule-random');

0 commit comments

Comments
 (0)