 }
 
 testSuite.test("Generic")
-    .xfail(.custom({ cannotUseObjCRuntimeHook },
+    .skip(.custom({ newOSButCannotUseObjCRuntimeHook },
                    reason: "hook for class_getImageName not present"))
     .code {
   check(GenericSwiftObject<Int>.self, in: "libGetImageNameHelper.dylib")

}

testSuite.test("GenericAncestry")
    .xfail(.custom({ cannotUseObjCRuntimeHook },
                   reason: "hook for class_getImageName not present"))
    .code {
  check(GenericAncestrySwiftObject.self, in: "libGetImageNameHelper.dylib")

             "wrong library for \(cls)")
}

var newOSButCannotUseObjCRuntimeHook = false
if #available(macOS 10.14, iOS 12, tvOS 12, watchOS 5, *) {
  // The only place these tests will fail is on early versions of the 2018 OSs.
  // The final versions will have 'objc_setHook_getImageName'; anything earlier
  // will be handled by manually overwriting the original implementation of
  // 'class_getImageName'.
  newOSButCannotUseObjCRuntimeHook =
      (nil == dlsym(UnsafeMutableRawPointer(bitPattern: -2),
                    "objc_setHook_getImageName"))
}

var testSuite = TestSuite("class_getImageName")

