Closed PaulTaykalo closed 5 years ago
:+1:
Is there a reason this hasn't landed on master?
LGTM! @sharplet could we get this one merged in? :pray:
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:
+testInvocations
was updated to memoize the array, rather than maintaining a global dictionary mapping class names to test invocations. This should be achievable by storing the test invocations as an associated object on the class, and then following the lazy initialisation pattern to return the existing invocations array if it already exists.+testCaseWithSelector:
should just be a simple search of the memoized array.+testCaseWithSelector:
called isn't ideal. Rather than simply memoizing the testInvocations
array, if we used a dictionary mapping selectors to test invocations then it's a simple O(1) lookup.Open to discussion on this, so let me know what you think.
Hm... it seems that last commit broke previous one. Will update this one shortly.
@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.
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?
@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
In Xcode 7, XCTest behaves like this:
+testInvocations
method is called+testCaseWithSelector:
method called+testInvocations
methodkw_example
, and incorrect name is returned[[KWSepc (null])
this leads to the case, when Xcode at some point stops correctly showing Kiwi Spec names
With this patch, Xcode correctly resolves underlying tests:
Also, this patch fixes crashes, which xctool generates, when trying to parse test name: https://github.com/facebook/xctool/issues/572