Skip to content
Open
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
19 changes: 13 additions & 6 deletions src/testDiscovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,25 @@ function extractTestNames(testCommandStdout: string): string[] {
}

function extractAssemblyPaths(testCommandStdout: string): string[] {
const testRunLineRegex = /^Test run for (.+\.dll)\(.+\)/gm;
let results = extractFirstRegexMatch(testCommandStdout, /^Test run for (.+\.dll)\(.+\)/gm);
if(results.length == 0)
{
// fix for dotnet 3.0 or output in other languages.
results = extractFirstRegexMatch(testCommandStdout, /^.*"(.+\.dll)"\s*\(.+\)/gm);

}
return results;
}

function extractFirstRegexMatch(testCommandStdout: string, regex: RegExp) {
const results = [];
let match = null;

do {
match = testRunLineRegex.exec(testCommandStdout);
match = regex.exec(testCommandStdout);
if (match) {
results.push(match[1]);
}
}
while (match);

} while (match);
return results;
}

Expand Down