Skip to content

Commit c2a0254

Browse files
committed
Allow skipping tests with a flag, instead of the environment variable
1 parent 13d60ca commit c2a0254

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/Commands/SwiftTestTool.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,11 @@ public class SwiftTestTool: SwiftTool<TestToolOptions> {
420420
"<test-target>.<test-case>/<test>"),
421421
to: { $0._testCaseSpecifier = .regex($1) })
422422

423+
binder.bind(
424+
option: parser.add(option: "--skip", kind: String.self,
425+
usage: "Skip test cases that match a colon-separated list of regular expressions, Example: --skip Performance:Scrypt"),
426+
to: { $0._testCaseSpecifier = .skip($1.split(separator: ":", omittingEmptySubsequences: true).map(String.init)) })
427+
423428
binder.bind(
424429
option: parser.add(option: "--enable-code-coverage", kind: Bool.self,
425430
usage: "Test with code coverage enabled"),
@@ -1086,6 +1091,6 @@ final class XUnitGenerator {
10861091

10871092
private extension Diagnostic.Message {
10881093
static var noMatchingTests: Diagnostic.Message {
1089-
.warning("'--filter' predicate did not match any test case")
1094+
.warning("No matching test cases were run")
10901095
}
10911096
}

0 commit comments

Comments
 (0)