Skip to content

Commit cdfb2ce

Browse files
authored
Path fix for lcov coverage implementation (#4356)
The path returned by the lcov parser could contain a carriage return in the case where it's a windows path.
1 parent ef0bef8 commit cdfb2ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/coverage.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as vscode from 'vscode';
22
import { lcovParser } from "@friedemannsommer/lcov-parser";
33
import * as nls from 'vscode-nls';
44
import * as logging from '@cmt/logging';
5+
import { platformNormalizePath } from './util';
56

67
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
78
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -32,7 +33,7 @@ export async function handleCoverageInfoFiles(run: vscode.TestRun, coverageInfoF
3233
}
3334
const sections = await lcovParser({ from: contents });
3435
for (const section of sections) {
35-
const coverage = new vscode.FileCoverage(vscode.Uri.file(section.path),
36+
const coverage = new vscode.FileCoverage(vscode.Uri.file(platformNormalizePath(section.path.trim())),
3637
new vscode.TestCoverageCount(
3738
section.lines.hit,
3839
section.lines.instrumented

0 commit comments

Comments
 (0)