@@ -22,18 +22,16 @@ func check(_ cls: AnyClass, in library: String) {
22
22
" wrong library for \( cls) " )
23
23
}
24
24
25
- var cannotUseObjCRuntimeHook = false
26
- #if targetEnvironment(device) && !os(macOS)
27
- if #available( iOS 12 , tvOS 12 , watchOS 5 , * ) {
25
+ var newOSButCannotUseObjCRuntimeHook = false
26
+ if #available( macOS 10 . 14 , iOS 12 , tvOS 12 , watchOS 5 , * ) {
28
27
// The only place these tests will fail is on early versions of the 2018 OSs.
29
28
// The final versions will have 'objc_setHook_getImageName'; anything earlier
30
29
// will be handled by manually overwriting the original implementation of
31
30
// 'class_getImageName'.
32
- cannotUseObjCRuntimeHook =
31
+ newOSButCannotUseObjCRuntimeHook =
33
32
( nil == dlsym ( UnsafeMutableRawPointer ( bitPattern: - 2 ) ,
34
33
" objc_setHook_getImageName " ) )
35
34
}
36
- #endif // targetEnvironment(device) && !os(macOS)
37
35
38
36
var testSuite = TestSuite ( " class_getImageName " )
39
37
@@ -43,7 +41,7 @@ testSuite.test("Simple") {
43
41
}
44
42
45
43
testSuite. test ( " Generic " )
46
- . xfail ( . custom( { cannotUseObjCRuntimeHook } ,
44
+ . skip ( . custom( { newOSButCannotUseObjCRuntimeHook } ,
47
45
reason: " hook for class_getImageName not present " ) )
48
46
. code {
49
47
check ( GenericSwiftObject< Int> . self , in: " libGetImageNameHelper.dylib " )
@@ -54,7 +52,7 @@ testSuite.test("Generic")
54
52
}
55
53
56
54
testSuite. test ( " GenericAncestry " )
57
- . xfail ( . custom( { cannotUseObjCRuntimeHook } ,
55
+ . skip ( . custom( { newOSButCannotUseObjCRuntimeHook } ,
58
56
reason: " hook for class_getImageName not present " ) )
59
57
. code {
60
58
check ( GenericAncestrySwiftObject . self, in: " libGetImageNameHelper.dylib " )
0 commit comments