appsquickly / typhoon

Powerful dependency injection for Objective-C ✨✨ (https://PILGRIM.PH is the pure Swift successor to Typhoon!!)✨✨
https://pilgrim.ph
Apache License 2.0
2.7k stars 270 forks source link

Not all test are run on Travis, example app exception #601

Open nicoabie opened 5 years ago

nicoabie commented 5 years ago

I'm having an issue with the sample app see comment

And while trying to investigate further and see if I could fixed I noticed that the TyphoonAssemblyBuilderTests that are responsible for checking the piece of code that throws the exception are not being run.

alexgarbarev commented 5 years ago

I can't remember all details now, but I had faced with similar problem before. It was tricky. The reason why [assmebly class] is not kind of [TyphoonAssembly class], because two class instances of TyphoonAssembly were compiled and exists in the memory at same time: one built for app target (host app) and one was built for test target. So in runtime it executes randomly: sometimes it's comparing with right class (superclass instance) and sometimes with parallel class. To fix that, you need to check that TyphoonAssembly is not included into your test target. It should only be included into app or framework target which is then tested by test target.