You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This patch adds support for XCTest integration by inverting the usual Catch behavior; rather than using Catch as the test runner, we dynamically register XCTestCase classes with the Objective-C runtime to allow Xcode's test runner to execute (and report on) Catch-defined test cases.
and
the +[XCTestCaseCatchRegistry load] method will insert an XCTestRegistryHub instance that automatically registers XCTestCase classes for any Catch test cases defined within the image.
Unfortunately, 5884ec1 made the registry hub a singleton of type Singleton<RegistryHub, IRegistryHub, IMutableRegistryHub>, and the methods getRegistryHub() and getMutableRegistryHub() need the type of the singleton to be statically defined, so the approach used in #454 is not working anymore.
To make #454 work in this context we would need a way to statically define the registry hub to be something like Singleton<XCTestRegistryHub, IRegistryHub, IMutableRegistryHub>, but I don't see how this could be possible, because XCTestRegistryHub needs to inherit at least from IRegistryHub, that is only available if we already included catch.hpp, but the definition of the singleton in catch.hpp would need XCTestRegistryHub to be defined before its inclusion.
Maybe I'm still missing something here (to be honest, I hope so), but I can't see any way to make #454 work with a singleton registry hub, and this brings me to the original question: are you really sure that a singleton registry hub is the right way to go?
Thanks, cheers
The text was updated successfully, but these errors were encountered:
Referring to #454 and this comment, I'm opening this issue to understand the developers point of view on this topic.
From the description of #454:
and
Unfortunately, 5884ec1 made the registry hub a singleton of type
Singleton<RegistryHub, IRegistryHub, IMutableRegistryHub>
, and the methodsgetRegistryHub()
andgetMutableRegistryHub()
need the type of the singleton to be statically defined, so the approach used in #454 is not working anymore.To make #454 work in this context we would need a way to statically define the registry hub to be something like
Singleton<XCTestRegistryHub, IRegistryHub, IMutableRegistryHub>
, but I don't see how this could be possible, becauseXCTestRegistryHub
needs to inherit at least fromIRegistryHub
, that is only available if we already includedcatch.hpp
, but the definition of the singleton incatch.hpp
would needXCTestRegistryHub
to be defined before its inclusion.Maybe I'm still missing something here (to be honest, I hope so), but I can't see any way to make #454 work with a singleton registry hub, and this brings me to the original question: are you really sure that a singleton registry hub is the right way to go?
Thanks, cheers
The text was updated successfully, but these errors were encountered: