Skip to content

Commit fbbb42a

Browse files
committed
Merge pull request #1130 from glessard/noobjc-testpredicate
Add cases .ObjCRuntime and .NativeRuntime to StdlibUnittest's TestPredicate
2 parents fabae07 + 6879dbd commit fbbb42a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,9 @@ public enum TestRunPredicate : CustomStringConvertible {
11651165

11661166
case FreeBSDAny(reason: String)
11671167

1168+
case ObjCRuntime(/*reason:*/ String)
1169+
case NativeRuntime(/*reason:*/ String)
1170+
11681171
public var description: String {
11691172
switch self {
11701173
case Custom(_, let reason):
@@ -1241,6 +1244,11 @@ public enum TestRunPredicate : CustomStringConvertible {
12411244

12421245
case FreeBSDAny(reason: let reason):
12431246
return "FreeBSDAny(*, reason: \(reason))"
1247+
1248+
case ObjCRuntime(let reason):
1249+
return "Objective-C runtime, reason: \(reason))"
1250+
case NativeRuntime(let reason):
1251+
return "Native runtime (no ObjC), reason: \(reason))"
12441252
}
12451253
}
12461254

@@ -1485,6 +1493,20 @@ public enum TestRunPredicate : CustomStringConvertible {
14851493
default:
14861494
return false
14871495
}
1496+
1497+
case ObjCRuntime:
1498+
#if _runtime(_ObjC)
1499+
return true
1500+
#else
1501+
return false
1502+
#endif
1503+
1504+
case NativeRuntime:
1505+
#if _runtime(_ObjC)
1506+
return false
1507+
#else
1508+
return true
1509+
#endif
14881510
}
14891511
}
14901512
}

0 commit comments

Comments
 (0)