@@ -593,8 +593,8 @@ describe('xcodebuild-event-parser', () => {
593593 expect ( summary ) . toMatchObject ( {
594594 fragment : 'build-summary' ,
595595 operation : 'TEST' ,
596- totalTests : 5 ,
597- passedTests : 5 ,
596+ totalTests : 2 ,
597+ passedTests : 2 ,
598598 failedTests : 0 ,
599599 skippedTests : 0 ,
600600 } ) ;
@@ -624,7 +624,7 @@ describe('xcodebuild-event-parser', () => {
624624 ] ) ;
625625 } ) ;
626626
627- it ( 'does not double-count xcodebuild-formatted test lines when a Swift Testing summary follows ' , ( ) => {
627+ it ( 'keeps xcodebuild-formatted test lines independent from Swift Testing summaries ' , ( ) => {
628628 const events = collectEvents ( 'TEST' , [
629629 {
630630 source : 'stdout' ,
@@ -639,7 +639,7 @@ describe('xcodebuild-event-parser', () => {
639639 const progress = events . filter ( ( event ) => event . fragment === 'test-progress' ) ;
640640 expect ( progress ) . toEqual ( [
641641 expect . objectContaining ( { completed : 1 , failed : 0 , skipped : 0 } ) ,
642- expect . objectContaining ( { completed : 1 , failed : 0 , skipped : 0 } ) ,
642+ expect . objectContaining ( { completed : 2 , failed : 0 , skipped : 0 } ) ,
643643 ] ) ;
644644 } ) ;
645645
@@ -662,6 +662,29 @@ describe('xcodebuild-event-parser', () => {
662662 ] ) ;
663663 } ) ;
664664
665+ it ( 'keeps parameterized Swift Testing result counts aligned with the run summary' , ( ) => {
666+ const events = collectRunStateEvents ( [
667+ {
668+ source : 'stdout' ,
669+ text : '✔ Test "Parameterized test" with 4 test cases passed after 0.001 seconds.\n' ,
670+ } ,
671+ {
672+ source : 'stdout' ,
673+ text : '✔ Test run with 1 test in 1 suite passed after 0.001 seconds.\n' ,
674+ } ,
675+ ] ) ;
676+
677+ const summary = events . filter ( ( event ) => event . fragment === 'build-summary' ) . at ( - 1 ) ;
678+ expect ( summary ) . toMatchObject ( {
679+ fragment : 'build-summary' ,
680+ operation : 'TEST' ,
681+ totalTests : 1 ,
682+ passedTests : 1 ,
683+ failedTests : 0 ,
684+ skippedTests : 0 ,
685+ } ) ;
686+ } ) ;
687+
665688 it ( 'processes full test lifecycle' , ( ) => {
666689 const events = collectEvents ( 'TEST' , [
667690 { source : 'stdout' , text : 'Resolve Package Graph\n' } ,
@@ -684,7 +707,7 @@ describe('xcodebuild-event-parser', () => {
684707 expect ( fragments ) . toContain ( 'test-failure' ) ;
685708 } ) ;
686709
687- it ( 'increments counts by caseCount for parameterized Swift Testing results ' , ( ) => {
710+ it ( 'counts parameterized Swift Testing result lines once for progress ' , ( ) => {
688711 const events = collectEvents ( 'TEST' , [
689712 {
690713 source : 'stdout' ,
@@ -695,7 +718,7 @@ describe('xcodebuild-event-parser', () => {
695718 const progress = events . filter ( ( e ) => e . fragment === 'test-progress' ) ;
696719 expect ( progress ) . toHaveLength ( 1 ) ;
697720 if ( progress [ 0 ] . fragment === 'test-progress' ) {
698- expect ( progress [ 0 ] . completed ) . toBe ( 3 ) ;
721+ expect ( progress [ 0 ] . completed ) . toBe ( 1 ) ;
699722 }
700723 } ) ;
701724
0 commit comments