kiwi-bdd / Kiwi

Simple BDD for iOS
BSD 3-Clause "New" or "Revised" License
4.14k stars 512 forks source link

Fixed KWSpec for multiple XCTest framework passes #648

Closed PaulTaykalo closed 5 years ago

PaulTaykalo commented 8 years ago

In Xcode 7, XCTest behaves like this:

this leads to the case, when Xcode at some point stops correctly showing Kiwi Spec names

viewcontrollerspec_m

With this patch, Xcode correctly resolves underlying tests:

example_xcodeproj

Also, this patch fixes crashes, which xctool generates, when trying to parse test name: https://github.com/facebook/xctool/issues/572

flovilmart commented 8 years ago

:+1:

matt-holden commented 8 years ago

Is there a reason this hasn't landed on master?

ecaselles commented 8 years ago

LGTM! @sharplet could we get this one merged in? :pray:

sharplet commented 8 years ago

Ok, so this looks really cool! Does it also solve the issue where test names briefly show up in the test navigator and disappear (as described in https://github.com/Quick/Quick/issues/219)?

So the high-level idea is to cache the results of +testInvocations so that when we receive +testCaseWithSelector: we can look up the invocation we already created, right?

A couple of notes on the implementation:

Open to discussion on this, so let me know what you think.

PaulTaykalo commented 8 years ago

Hm... it seems that last commit broke previous one. Will update this one shortly.

PaulTaykalo commented 8 years ago

@sharplet as about Quick/Quick#219 - I'm just nit sure that we have the same problem here. But yes - veryt method is currently visible in Xcode

As about other things you mentioned - I've tried to do like you suggested (https://github.com/PaulTaykalo/Kiwi/commit/b06edaa3b6422809d308a66f2541b49296cb7bc7), but for some reason it just doesn't work that way. Looking currently what's going on there.

orta commented 8 years ago

Is this being actively worked on? looks like it might be ready to go.

@PaulTaykalo can you give me a quick summary of it's status?

PaulTaykalo commented 8 years ago

@orta At least it isn't crashing xctool :) This is all what I remember. also, In Xcode you won't see (Kiwi (null)s anymore. Still this one doesn't allow to run KiwiTests by file or by test