Skip to content

Commit

Permalink
Adds location information in the call to appendOutput.
Browse files Browse the repository at this point in the history
The test object may have uri and ranges that can help localization
  • Loading branch information
hippo91 authored and Guillaume Peillex committed May 15, 2024
1 parent 5ce37f1 commit c4c15d7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ctest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,11 @@ export class CTestDriver implements vscode.Disposable {
let output = testResult.output;
// https://code.visualstudio.com/api/extension-guides/testing#test-output
output = output.replace(/\r?\n/g, '\r\n');
run.appendOutput(output, undefined, test);
if (test.uri && test.range) {
run.appendOutput(output, new vscode.Location(test.uri, test.range.end), test);
} else {
run.appendOutput(output, undefined, test);
}

if (testResult.status !== 'passed' && !havefailures) {
const failureDurationStr = testResult.measurements.get("Execution Time")?.value;
Expand Down Expand Up @@ -936,7 +940,7 @@ export class CTestDriver implements vscode.Disposable {
.find(test => test.name === testName)?.properties
.find(prop => prop.name === 'WORKING_DIRECTORY');

if (typeof(property?.value) === 'string') {
if (typeof (property?.value) === 'string') {
return property.value;
}
return '';
Expand Down

0 comments on commit c4c15d7

Please sign in to comment.