diff --git a/Sources/XcbeautifyLib/Parser.swift b/Sources/XcbeautifyLib/Parser.swift index d91ad333..445bb2a0 100644 --- a/Sources/XcbeautifyLib/Parser.swift +++ b/Sources/XcbeautifyLib/Parser.swift @@ -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 @@ -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) { diff --git a/Sources/XcbeautifyLib/TestSummary.swift b/Sources/XcbeautifyLib/TestSummary.swift index 53c6c142..a2d1c948 100644 --- a/Sources/XcbeautifyLib/TestSummary.swift +++ b/Sources/XcbeautifyLib/TestSummary.swift @@ -1,4 +1,4 @@ -struct TestSummary { +public struct TestSummary { let testsCount: Int let skippedCount: Int let failuresCount: Int diff --git a/Sources/XcbeautifyLib/XCFormatter.swift b/Sources/XcbeautifyLib/XCFormatter.swift index 98274aaa..f8ea589d 100644 --- a/Sources/XcbeautifyLib/XCFormatter.swift +++ b/Sources/XcbeautifyLib/XCFormatter.swift @@ -198,4 +198,8 @@ public struct XCFormatter { return nil } } + + public func formatTestSummary(testSummary: TestSummary) -> String { + renderer.format(testSummary: testSummary) + } } diff --git a/Sources/xcbeautify/Xcbeautify.swift b/Sources/xcbeautify/Xcbeautify.swift index 35d4f9dc..3ed4983b 100644 --- a/Sources/xcbeautify/Xcbeautify.swift +++ b/Sources/xcbeautify/Xcbeautify.swift @@ -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) }