Skip to content

Commit

Permalink
chore: remove unnecessary processing during test listing
Browse files Browse the repository at this point in the history
  • Loading branch information
GNMoseke committed Jul 8, 2024
1 parent 881803f commit 4ae9176
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/TestRunner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,13 @@ class PeregrineRunner: TestRunner {

var tests = [Test]()
for try await line in listProcess.stdout.lines {
// `swift test list` output is standard across OS - thankfully
logger.trace("swift test list stdout: \(line)")
guard let remainder = line.split(separator: ".").last else {
throw TestParseError.unexpectedLineFormat("Could not parse test definition from \(line)")
}
let suiteAndName = remainder.split(separator: "/")
guard let testSuite = suiteAndName.first?.trimmingPrefix("-["), let testName = suiteAndName.last else {
guard let testSuite = suiteAndName.first, let testName = suiteAndName.last else {
throw TestParseError.unexpectedLineFormat("Could not parse test definition from \(line)")
}
let test = Test(suite: String(testSuite), name: String(testName))
Expand Down

0 comments on commit 4ae9176

Please sign in to comment.