Re: Objective-C Unit Testing
Re: Objective-C Unit Testing
- Subject: Re: Objective-C Unit Testing
- From: Chris Hanson <email@hidden>
- Date: Mon, 29 Mar 2010 16:36:32 -0700
On Mar 29, 2010, at 3:14 PM, Seth Willits wrote:
> I have a Cocoa app that I'm trying to add a unit testing target to. I followed the steps in the Unit Testing guide to create a dependent target, but I'm having link errors whenever I try to use a class from my app.
>
> According to this guide by creating a dependent target, I don't need to add any of the code from the app into the testing target. It'll just link correctly at runtime. Well... it's failing.
>
> I'm hoping someone can tell me what the missing step to getting this to work is. I added my app's target as a dependency in the testing target, set the bundle loader and test host build settings, created a test case, and tried to instantiate an object of a class included in my app, and I get a link error saying that the class's symbol can't be found.
You’ll need to add a build setting to your app target to have its symbols not hidden by default. In the 64-bit runtime, each Objective-C class generates a symbol that users of the class link against; these aren’t exported by default for executables like they are for libraries.
Another option is to add a .exp file for your app to declare explicitly what classes you wish to expose to those that link against it. You can specify this file in the appropriate build setting and the linker will use it to determine which class symbols to hide and which to expose.
— Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden