mattgallagher / CwlPreconditionTesting

A Mach exception handler that allows Swift precondition failures to be caught and tested.
ISC License
175 stars 46 forks source link

Add tvOS support #3

Closed abbeycode closed 8 years ago

abbeycode commented 8 years ago

I'm working on adding assertion validation to Nimble, which supports tvOS. I'm getting errors for that target, though, so I figured I'd try adding a tvOS framework to this library directly and flush out the issues. I'll be pushing a branch with the tvOS targets shortly.

abbeycode commented 8 years ago

The branch I pushed demonstrates the issue I'm also seeing in Nimble. Namely, CwlCatchBadInstruction.swift isn't able to find mach_msg or thread_swap_exception_ports.

mattgallagher commented 8 years ago

If you command-click on mach_msg in Xcode, you'll see that the function exists in the Darwin.Mach module but is flagged __WATCHOS_PROHIBITED and __TVOS_PROHIBITED. This makes Mach message handling – even in the simulator – impossible for watchOS or tvOS.

I've done a quick test here and you can use the POSIX signals alternate implementation instead (need to turn "Debug Executable" off the in the scheme's "Test" rules for the POSIX version to work).

abbeycode commented 8 years ago

Thanks, I'll take a look at that approach!

mattgallagher commented 8 years ago

tvOS target is merged.