@@ -83,12 +83,6 @@ func entryPoint(passing args: __CommandLineArguments_v0?, eventHandler: Event.Ha
8383 }
8484#endif
8585
86- // If the client has requested repetitions via CLI flags, turn off plan-level repetition
87- // and use test-case-level repetition instead.
88- if args. repetitions != nil || args. repeatUntil != nil {
89- configuration. shouldUseLegacyPlanLevelRepetition = false
90- }
91-
9286 // If the caller specified an alternate event handler, hook it up too.
9387 if let eventHandler {
9488 configuration. eventHandler = { [ oldEventHandler = configuration. eventHandler] event, context in
@@ -339,6 +333,8 @@ public struct __CommandLineArguments_v0: Sendable {
339333 /// The value of the `--repeat-until` argument.
340334 public var repeatUntil : String ?
341335
336+ var usePerTestCaseRepetition : Bool = false
337+
342338 /// The value of the `--attachments-path` argument.
343339 public var attachmentsPath : String ?
344340}
@@ -543,6 +539,9 @@ func parseCommandLineArguments(from args: [String]) throws -> __CommandLineArgum
543539 if let repeatUntil = args. argumentValue ( forLabel: " --repeat-until " ) {
544540 result. repeatUntil = repeatUntil
545541 }
542+ if args. contains ( " --experimental-per-test-case-repetition " ) {
543+ result. usePerTestCaseRepetition = true
544+ }
546545
547546 return result
548547}
@@ -671,6 +670,9 @@ public func configurationForEntryPoint(from args: __CommandLineArguments_v0) thr
671670 }
672671 configuration. repetitionPolicy = repetitionPolicy
673672
673+ // Opt in to per-test-case repetition
674+ configuration. shouldUseLegacyPlanLevelRepetition = !args. usePerTestCaseRepetition
675+
674676#if !SWT_NO_EXIT_TESTS
675677 // Enable exit test handling via __swiftPMEntryPoint().
676678 configuration. exitTestHandler = ExitTest . handlerForEntryPoint ( )
0 commit comments