@@ -56,11 +56,9 @@ extension Event {
56
56
/// The instant at which the test started.
57
57
var startInstant : Test . Clock . Instant
58
58
59
- /// The number of issues with error severity recorded for the test.
60
- var errorIssueCount = 0
61
-
62
- /// The number of issues with warning severity recorded for the test.
63
- var warningIssueCount = 0
59
+ /// The number of issues recorded for the test, grouped by their
60
+ /// level of severity.
61
+ var issueCount : [ Issue . Severity : Int ] = [ : ]
64
62
65
63
/// The number of known issues recorded for the test.
66
64
var knownIssueCount = 0
@@ -121,8 +119,8 @@ extension Event.HumanReadableOutputRecorder {
121
119
guard let graph else {
122
120
return ( 0 , 0 , 0 , 0 , " " )
123
121
}
124
- let errorIssueCount = graph. compactMap ( \ . value? . errorIssueCount ) . reduce ( into: 0 , += )
125
- let warningIssueCount = graph. compactMap ( \ . value? . warningIssueCount ) . reduce ( into: 0 , += )
122
+ let errorIssueCount = graph. compactMap { $0 . value? . issueCount [ . error ] } . reduce ( into: 0 , += )
123
+ let warningIssueCount = graph. compactMap { $0 . value? . issueCount [ . warning ] } . reduce ( into: 0 , += )
126
124
let knownIssueCount = graph. compactMap ( \. value? . knownIssueCount) . reduce ( into: 0 , += )
127
125
let totalIssueCount = errorIssueCount + warningIssueCount + knownIssueCount
128
126
@@ -279,12 +277,7 @@ extension Event.HumanReadableOutputRecorder {
279
277
if issue. isKnown {
280
278
testData. knownIssueCount += 1
281
279
} else {
282
- switch issue. severity {
283
- case . warning:
284
- testData. warningIssueCount += 1
285
- case . error:
286
- testData. errorIssueCount += 1
287
- }
280
+ testData. issueCount [ issue. severity, default: 0 ] += 1
288
281
}
289
282
context. testData [ id] = testData
290
283
0 commit comments