Occasional errors when running OCUnit application test suite on device

一曲冷凌霜 提交于 2019-11-30 06:44:07

Do you have NSZombieEnabled? I had this issue when I had NSZombieEnabled set to YES in my arguments for my unit test launch target. I've tried everything (cleaning/quitting XCode/restting simulator content). The only solution so far was to disable zombie in my unit test launch

I think I've just figured out why I was getting this error as well -- perhaps the same thing is happening to you:

I have two products set up, one for internal beta testing (complete with a preference pane) and one for app store release. Both product targets were set up with the same Product Name (PRODUCT_NAME in build settings).

This worked fine in XCode 3.x, but XCode 4 was somehow trying to build the store product each time I built the beta product. I think this is due to the change in where XCode puts its derived files -- XCode 4 was storing the beta and store products at the same path, so when the beta product was built, the store output file changed and needed to be rebuilt...

Anyway... changing the beta Product Name has fixed temporarily fixed the issue... I've also changed the bundle identifier in the Info.plist so the two products have different identifiers. Now when I build one product, the other doesn't get built at the same time, but I still get the crash when the tests run :-(

My only idea now is to totally recreate the project from fresh, copying across the settings and the files to see if XCode 4 does something different. That and filing a support incident with Apple...

Cheers,

Adam

I am not 100% sure yet, but it seems this issue can be solved by creating different scheme for each test target. I had this error a lot this afternoon but it hasn't happened for awhile after I created separate schemes for different test targets.

Just for anyone that might run into this issue like I have:

KIFTester loaded
Assertion failure in -[SenTestClassEnumerator init], /SourceCache/OCUnit/OCUnit-5315/SourceCode/SenTestingKit/SenTestClassEnumerator.m:136
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'objc_getClassList returned more classes than it should have.'

The problem turned out to be GoogleAnalytics 3.0 Updated to 3.0.3 but still the same problem with either of these libraries libGoogleAnalytics_debug.a libGoogleAnalyticsServices.a

To go around it I just don't include them for testing.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!