Hi Brian!
Thanks for the replies. I haven’t been able to hack on this for a few days
but hopefully I can over the holiday break this weekend.
I’ve been experimenting with building XCTest for watchOS and constructing a
test harness. I’ve gotten it to the point where I can execute the same test
cla
I'm curious: what are you hoping to accomplish with corelibs-xctest? If we
can help you by modifying corelibs-xctest itself, that could be another
option here. :)
- Brian Gesiak
On Mon, Nov 21, 2016 at 10:46 AM, Jeff Kelley via swift-users <
swift-users@swift.org> wrote:
> The type comes from X
The type comes from XCTest. I’m trying to enumerate Objective-C methods in
order to use them with XCTest in the open-source Swift version of XCTest, which
needs the tests to be supplied as this type:
/// This is a compound type used by `XCTMain` to represent tests to run. It
combines an
/// `XC
"throws" is the part that's not representable in Obj-C. Why are you using
it? If you're interacting with method_getImplementation, you need to think
like the Obj-C runtime.
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtHowMessagingWorks.ht
Still trying on this (copied the code directly, Foo is actually XCTestCase):
typealias TestMethod = @convention(c) (XCTestCase) throws -> Void
This seagulls the compiler with “error: '(XCTestCase) throws -> Void' is not
representable in Objective-C, so it cannot be used with '@convention(c)’”. I
For a function such as bar() above, the type you want to cast the IMP to
would probably be "@convention(c) (Foo, Selector) -> ()".
On Sun, Nov 20, 2016 at 9:05 PM, Jeff Kelley wrote:
> Thanks Jacob! I tried using unsafeBitCast, but it fails with the
> following: “fatal error: can't unsafeBitCast
Thanks Jacob! I tried using unsafeBitCast, but it fails with the following:
“fatal error: can't unsafeBitCast between types of different sizes”. I
considered wrapping every call in a closure that calls objc_msgSend(), but
alas, that’s not exposed to Swift. I have another approach in mind, so I’l
I imagine unsafeBitCast would be the way to go here. But are you assuming
that all of the instance methods have type "(Foo) throws -> Void" ? Or do
you somehow want to dynamically use the type information?
Jacob
On Fri, Nov 18, 2016 at 10:37 PM, Jeff Kelley via swift-users <
swift-users@swift.org