Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode test navigator integration #1

Closed
modocache opened this issue Jun 5, 2014 · 3 comments
Closed

Xcode test navigator integration #1

modocache opened this issue Jun 5, 2014 · 3 comments
Labels

Comments

@modocache
Copy link
Member

Currently tests do not appear correctly in Xcode's test navigator.

@modocache
Copy link
Member Author

Turns out Specta has same issue: specta/specta#83

@modocache
Copy link
Member Author

Specta works on Xcode 5 and prior, but I'm not sure why. I believe XCTest used to infer the name of the test case by taking -[XCTestCase name], removing the name of the XCTestCase subclass, stripping any characters not allowed in method names, and then using what was left.

In Xcode 6, it appears to use NSStringFromSelector() on the selector of the current test cases's NSInvocation. This makes a lot of sense from Apple's point of view, but it makes things difficult for Specta and Quick. Quick calls the same selector multiple times---[XCTestCase runExampleAtIndex:]--with different parameters.

Maybe I can get around this by defining appropriately named methods at runtime.

modocache added a commit that referenced this issue Jun 9, 2014
This fixes issue #1: Xcode test navigator integration.

As of Xcode 6, each test invocation's selector is used to determine the
name displayed in the test navigator. Specta and Quick both used the
same instance method (`-[QuickSpec runExampleAtIndex:]`, in Quick's
case) to run each example. As a result, all tests in the same spec had
the same name, causing each example to "overwrite" each previous one in
the navigator. This caused several issues, including red lines to
indicate test failure in Xcode suddenly disappearing when the next
example finished running.

During `+[QuickSpec testInvocations]`, define a new instance method for
each example. Then, return an invocation that executes that new instance
method
@modocache
Copy link
Member Author

modocache pushed a commit that referenced this issue Jun 27, 2014
NachoSoto pushed a commit to NachoSoto/Quick that referenced this issue Jul 5, 2016
Get the unit tests building & passing for macOS and iOS targets
NachoSoto pushed a commit to NachoSoto/Quick that referenced this issue Jul 18, 2016
NachoSoto pushed a commit to NachoSoto/Quick that referenced this issue Jul 18, 2016
karagraysen pushed a commit that referenced this issue Aug 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant