Skip to content

Commit

Permalink
Re-introduce formatTestSummary
Browse files Browse the repository at this point in the history
  • Loading branch information
cpisciotta committed Nov 24, 2023
1 parent 477bfee commit 78c46fd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
8 changes: 1 addition & 7 deletions Sources/XcbeautifyLib/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ public class Parser {

private let additionalLines: () -> String?

private(set) var summary: TestSummary? = nil
public private(set) var summary: TestSummary? = nil

private(set) var needToRecordSummary = false

Expand Down Expand Up @@ -149,12 +149,6 @@ public class Parser {
return result.captureGroup
}

public func formattedSummary() -> String? {
guard let summary = summary else { return nil }
return nil
// return renderer.format(testSummary: summary)
}

// MARK: Private

private func parseSummary(line: String, skipped: Bool) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcbeautifyLib/TestSummary.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
struct TestSummary {
public struct TestSummary {
let testsCount: Int
let skippedCount: Int
let failuresCount: Int
Expand Down
4 changes: 4 additions & 0 deletions Sources/XcbeautifyLib/XCFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,8 @@ public struct XCFormatter {
return nil
}
}

public func formatTestSummary(testSummary: TestSummary) -> String {
renderer.format(testSummary: testSummary)
}
}
3 changes: 2 additions & 1 deletion Sources/xcbeautify/Xcbeautify.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ struct Xcbeautify: ParsableCommand {
output.write(parser.outputType, formatted)
}

if let formattedSummary = parser.formattedSummary() {
if let summary = parser.summary {
let formattedSummary = formatter.formatTestSummary(testSummary: summary)
output.write(.result, formattedSummary)
}

Expand Down

0 comments on commit 78c46fd

Please sign in to comment.