@@ -142,6 +142,27 @@ enum Conformance_TestCategory: SwiftProtobuf.Enum, Swift.CaseIterable {
142
142
143
143
}
144
144
145
+ /// Meant to encapsulate all types of tests: successes, skips, failures, etc.
146
+ /// Therefore, this may or may not have a failure message. Failure messages
147
+ /// may be truncated for our failure lists.
148
+ struct Conformance_TestStatus : Sendable {
149
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
150
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
151
+ // methods supported on all messages.
152
+
153
+ var name : String = String ( )
154
+
155
+ var failureMessage : String = String ( )
156
+
157
+ /// What an actual test name matched to in a failure list. Can be wildcarded or
158
+ /// an exact match without wildcards.
159
+ var matchedName : String = String ( )
160
+
161
+ var unknownFields = SwiftProtobuf . UnknownStorage ( )
162
+
163
+ init ( ) { }
164
+ }
165
+
145
166
/// The conformance runner will request a list of failures as the first request.
146
167
/// This will be known by message_type == "conformance.FailureSet", a conformance
147
168
/// test should return a serialized FailureSet in protobuf_payload.
@@ -150,7 +171,7 @@ struct Conformance_FailureSet: Sendable {
150
171
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
151
172
// methods supported on all messages.
152
173
153
- var failure : [ String ] = [ ]
174
+ var test : [ Conformance_TestStatus ] = [ ]
154
175
155
176
var unknownFields = SwiftProtobuf . UnknownStorage ( )
156
177
@@ -441,10 +462,54 @@ extension Conformance_TestCategory: SwiftProtobuf._ProtoNameProviding {
441
462
]
442
463
}
443
464
465
+ extension Conformance_TestStatus : SwiftProtobuf . Message , SwiftProtobuf . _MessageImplementationBase , SwiftProtobuf . _ProtoNameProviding {
466
+ static let protoMessageName : String = _protobuf_package + " .TestStatus "
467
+ static let _protobuf_nameMap : SwiftProtobuf . _NameMap = [
468
+ 1 : . same( proto: " name " ) ,
469
+ 2 : . standard( proto: " failure_message " ) ,
470
+ 3 : . standard( proto: " matched_name " ) ,
471
+ ]
472
+
473
+ mutating func decodeMessage< D: SwiftProtobuf . Decoder > ( decoder: inout D ) throws {
474
+ while let fieldNumber = try decoder. nextFieldNumber ( ) {
475
+ // The use of inline closures is to circumvent an issue where the compiler
476
+ // allocates stack space for every case branch when no optimizations are
477
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
478
+ switch fieldNumber {
479
+ case 1 : try { try decoder. decodeSingularStringField ( value: & self . name) } ( )
480
+ case 2 : try { try decoder. decodeSingularStringField ( value: & self . failureMessage) } ( )
481
+ case 3 : try { try decoder. decodeSingularStringField ( value: & self . matchedName) } ( )
482
+ default : break
483
+ }
484
+ }
485
+ }
486
+
487
+ func traverse< V: SwiftProtobuf . Visitor > ( visitor: inout V ) throws {
488
+ if !self . name. isEmpty {
489
+ try visitor. visitSingularStringField ( value: self . name, fieldNumber: 1 )
490
+ }
491
+ if !self . failureMessage. isEmpty {
492
+ try visitor. visitSingularStringField ( value: self . failureMessage, fieldNumber: 2 )
493
+ }
494
+ if !self . matchedName. isEmpty {
495
+ try visitor. visitSingularStringField ( value: self . matchedName, fieldNumber: 3 )
496
+ }
497
+ try unknownFields. traverse ( visitor: & visitor)
498
+ }
499
+
500
+ static func == ( lhs: Conformance_TestStatus , rhs: Conformance_TestStatus ) -> Bool {
501
+ if lhs. name != rhs. name { return false }
502
+ if lhs. failureMessage != rhs. failureMessage { return false }
503
+ if lhs. matchedName != rhs. matchedName { return false }
504
+ if lhs. unknownFields != rhs. unknownFields { return false }
505
+ return true
506
+ }
507
+ }
508
+
444
509
extension Conformance_FailureSet : SwiftProtobuf . Message , SwiftProtobuf . _MessageImplementationBase , SwiftProtobuf . _ProtoNameProviding {
445
510
static let protoMessageName : String = _protobuf_package + " .FailureSet "
446
511
static let _protobuf_nameMap : SwiftProtobuf . _NameMap = [
447
- 1 : . same( proto: " failure " ) ,
512
+ 2 : . same( proto: " test " ) ,
448
513
]
449
514
450
515
mutating func decodeMessage< D: SwiftProtobuf . Decoder > ( decoder: inout D ) throws {
@@ -453,21 +518,21 @@ extension Conformance_FailureSet: SwiftProtobuf.Message, SwiftProtobuf._MessageI
453
518
// allocates stack space for every case branch when no optimizations are
454
519
// enabled. https://github.com/apple/swift-protobuf/issues/1034
455
520
switch fieldNumber {
456
- case 1 : try { try decoder. decodeRepeatedStringField ( value: & self . failure ) } ( )
521
+ case 2 : try { try decoder. decodeRepeatedMessageField ( value: & self . test ) } ( )
457
522
default : break
458
523
}
459
524
}
460
525
}
461
526
462
527
func traverse< V: SwiftProtobuf . Visitor > ( visitor: inout V ) throws {
463
- if !self . failure . isEmpty {
464
- try visitor. visitRepeatedStringField ( value: self . failure , fieldNumber: 1 )
528
+ if !self . test . isEmpty {
529
+ try visitor. visitRepeatedMessageField ( value: self . test , fieldNumber: 2 )
465
530
}
466
531
try unknownFields. traverse ( visitor: & visitor)
467
532
}
468
533
469
534
static func == ( lhs: Conformance_FailureSet , rhs: Conformance_FailureSet ) -> Bool {
470
- if lhs. failure != rhs. failure { return false }
535
+ if lhs. test != rhs. test { return false }
471
536
if lhs. unknownFields != rhs. unknownFields { return false }
472
537
return true
473
538
}
0 commit comments