diff --git a/src/client/testing/testController/common/resultsHelper.ts b/src/client/testing/testController/common/resultsHelper.ts index 957840c5962e9..f0b2fb8fc7c4c 100644 --- a/src/client/testing/testController/common/resultsHelper.ts +++ b/src/client/testing/testController/common/resultsHelper.ts @@ -112,7 +112,7 @@ export async function updateResultFromJunitXml( message.location = new Location(node.uri, node.range); } - runInstance.failed(node, message); + runInstance.errored(node, message); runInstance.appendOutput(text); } else if (result.failure) { failures += 1; @@ -147,10 +147,12 @@ export async function updateResultFromJunitXml( if (node.uri && node.range) { message.location = new Location(node.uri, node.range); } - runInstance.failed(node, message); + runInstance.errored(node, message); } }); + runInstance.appendOutput(`Total number of tests expected to run: ${testCaseNodes.length}\r\n`); + runInstance.appendOutput(`Total number of tests run: ${passed + failures + errors + skipped}\r\n`); runInstance.appendOutput(`Total number of tests passed: ${passed}\r\n`); runInstance.appendOutput(`Total number of tests failed: ${failures}\r\n`); runInstance.appendOutput(`Total number of tests failed with errors: ${errors}\r\n`); diff --git a/src/client/testing/testController/unittest/runner.ts b/src/client/testing/testController/unittest/runner.ts index 673166e0d6ef5..c54adac34f819 100644 --- a/src/client/testing/testController/unittest/runner.ts +++ b/src/client/testing/testController/unittest/runner.ts @@ -127,7 +127,7 @@ export class UnittestRunner implements ITestsRunner { message.location = new Location(testCase.uri, testCase.range); } - runInstance.failed(testCase, message); + runInstance.errored(testCase, message); runInstance.appendOutput(text); counts.errored += 1; if (failFast) { @@ -146,6 +146,7 @@ export class UnittestRunner implements ITestsRunner { if (testCase.uri && testCase.range) { message.location = new Location(testCase.uri, testCase.range); } + runInstance.errored(testCase, message); } } }); @@ -209,6 +210,8 @@ export class UnittestRunner implements ITestsRunner { this.server.stop(); } + runInstance.appendOutput(`Total number of tests expected to run: ${testCaseNodes.length}\r\n`); + runInstance.appendOutput(`Total number of tests run: ${counts.total}\r\n`); runInstance.appendOutput(`Total number of tests passed: ${counts.passed}\r\n`); runInstance.appendOutput(`Total number of tests failed: ${counts.failed}\r\n`); runInstance.appendOutput(`Total number of tests failed with errors: ${counts.errored}\r\n`); diff --git a/types/vscode.proposed.d.ts b/types/vscode.proposed.d.ts index 602b8c2d0e509..fc6e2d3a7d71b 100644 --- a/types/vscode.proposed.d.ts +++ b/types/vscode.proposed.d.ts @@ -1300,6 +1300,17 @@ declare module 'vscode' { */ failed(test: TestItem, message: TestMessage | readonly TestMessage[], duration?: number): void; + /** + * Indicates a test has errored. You should pass one or more + * {@link TestMessage | TestMessages} to describe the failure. This differs + * from the "failed" state in that it indicates a test that couldn't be + * executed at all, from a compilation error for example. + * @param test Test item to update. + * @param messages Messages associated with the test failure. + * @param duration How long the test took to execute, in milliseconds. + */ + errored(test: TestItem, message: TestMessage | readonly TestMessage[], duration?: number): void; + /** * Indicates a test has passed. * @param test Test item to update.