@@ -126,11 +126,11 @@ public class TestToolOptions: ToolOptions {
126
126
/// This is used to filter tests to run
127
127
/// .none => No filtering
128
128
/// .specific => Specify test with fully quantified name
129
- /// .regex => RegEx pattern
129
+ /// .regex => RegEx patterns
130
130
public enum TestCaseSpecifier {
131
131
case none
132
132
case specific( String )
133
- case regex( String )
133
+ case regex( [ String ] )
134
134
case skip( [ String ] )
135
135
}
136
136
@@ -415,7 +415,7 @@ public class SwiftTestTool: SwiftTool<TestToolOptions> {
415
415
to: { $0. xUnitOutput = $1. path } )
416
416
417
417
binder. bind (
418
- option: parser. add ( option: " --filter " , kind: String . self,
418
+ option: parser. add ( option: " --filter " , kind: [ String ] . self,
419
419
usage: " Run test cases matching regular expression, Format: <test-target>.<test-case> or " +
420
420
" <test-target>.<test-case>/<test> " ) ,
421
421
to: { $0. _testCaseSpecifier = . regex( $1) } )
@@ -958,10 +958,12 @@ fileprivate extension Dictionary where Key == AbsolutePath, Value == [TestSuite]
958
958
switch specifier {
959
959
case . none:
960
960
return allTests
961
- case . regex( let pattern ) :
961
+ case . regex( let patterns ) :
962
962
return allTests. filter ( { test in
963
- test. specifier. range ( of: pattern,
964
- options: . regularExpression) != nil
963
+ patterns. contains { pattern in
964
+ test. specifier. range ( of: pattern,
965
+ options: . regularExpression) != nil
966
+ }
965
967
} )
966
968
case . specific( let name) :
967
969
return allTests. filter { $0. specifier == name }
0 commit comments