Skip to content

Fix running of a single testmethod #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/commonRunTestsHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,18 @@ export async function commonRunTestsHandler(controller: vscode.TestController, r

// enqueue everything up front so user sees immediately which tests will run
mapTestClasses.forEach((test) => {
let methodTarget = "";
if (request.include?.length === 1) {
const idParts = request.include[0].id.split(":");
if (idParts.length === 5) {
methodTarget = request.include[0].id;
}
}
test.children.forEach((methodTest) => {
if (methodTarget && methodTarget !== methodTest.id) {
// User specified a single test method to run, so skip all others
return;
}
run.enqueued(methodTest);
});
});
Expand Down Expand Up @@ -253,7 +264,7 @@ export async function commonRunTestsHandler(controller: vscode.TestController, r
if (request.include?.length === 1) {
const idParts = request.include[0].id.split(":");
if (idParts.length === 5) {
testSpec = `${username}:${idParts[3]}:${idParts[4]}`;
testSpec = `${username}\\${idParts[3].split(".").slice(0, -1).join("\\")}:${idParts[3]}:${idParts[4]}`;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/debugTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ export class DebugTracker implements vscode.DebugAdapterTracker {
const assertFailedMatch = line.match(/^(Assert\w+):(.*) \(failed\) <<====/);
if (assertFailedMatch) {
//const macroName = assertFailedMatch[1];
const message = assertFailedMatch[2];
const failedMessage = assertFailedMatch[2];
//console.log(`Class ${this.className}, Test-method ${this.testMethodName}, macroName ${macroName}, outcome 'failed', message=${message}`);
this.failureMessages.push({ message: message });
this.failureMessages.push({ message: failedMessage });
} else {
const assertSkippedMatch = line.match(/^ (Test\w+):(.*) \(skipped\)$/);
if (assertSkippedMatch) {
Expand Down
Loading