allending/Kiwi — pull request #366 by modocache (2013-09-12 18:08:20+00:00)
Title: Support .xctest Unit Testing Bundles

### Commit Message

- Add Kiwi subspec which defines preprocessor macro KIWI_XCTEST.
- KWSpec inherits from XCTestCase or SenTestCase based on value of
KIWI_XCTEST.

.xctest bundles do not run any tests defined on subclasses of
SenTestCase. Prior to this commit, KWSpec inherits from SenTestCase.
This means that developers creating new projects using Xcode 5, which
includes an .xctest bundle by default, cannot use Kiwi to run tests
on new projects.

Simply changing the base class of KWSpec from SenTestCase to XCTestCase,
on the other hand, causes the opposite problem to occur; .octest bundles
only run tests associated with subclasses of SenTestCase, so the
XCTestCase classes are ignored.

Since there is no way to programmatically determine whether
the test bundle is .xctest or .octest, this commit leaves it up to the
user to specify. Developers using .octest bundles do not need to do
anything; this commit changes the default subspec to be compatible with
SenTestingKit, just as it was before. Developers using .xctest bundles,
however, can specify the "Kiwi/XCTest" subspec in order to have KWSpec
inherit from XCTestCase. This allows the tests to at least be run.
However, XCTestCase requires file names, line numbers, and other
information to be specified for failures. This commit does not include
this information, so individual failures are not reported in the Xcode 5
test navigator.

### Additional Information

This is a work in progress. I am currently adding a new test target (XCTest type) to the Kiwi project in order to demonstrate the new behavior. I would appreciate feedback on this approach, however--I'm not sure using a preprocessor macro is the best way to go about doing this, but I can't think of a better idea at the moment.

It would be great to get some sort of XCTest support out there before Xcode 5 comes out next week. :wink: :soon: