Re: Using XCTest on a static library with a bundle
Re: Using XCTest on a static library with a bundle
- Subject: Re: Using XCTest on a static library with a bundle
- From: Joar Wingfors <email@hidden>
- Date: Tue, 22 Oct 2013 21:59:42 -0700
Hi John,
When setting up tests for a library you need to configure the test target like you would configure an app target making use of that same library. The specifics will vary from project to project, but there are generally only a few things that you need to verify are being set up correctly - This includes things like making sure that the test target is configured to link to your library, and that it has the appropriate header search paths.
To figure this out, it may be easier for you to create a new project for a new static library target and then set up tests for that. Once you have it working in isolation, you can then probably resolve why it didn't work in your larger and real world project by comparing the two.
The link that you referenced doesn't talk about how to configure a test target for a library, it talks about how to configure a test target for an application. The best documentation that Apple offers on the topic can be found here:
<https://developer.apple.com/legacy/library/documentation/DeveloperTools/Conceptual/UnitTesting/02-Setting_Up_Unit_Tests_in_a_Project/setting_up.html#//apple_ref/doc/uid/TP40002143-CH3-SW5>
That document is currently a bit out of date and incomplete - It doesn't document XCTest, and it doesn't go into some of the necessary steps, such as making sure to link to your library.
Joar
On 22 okt 2013, at 07:32, John Spicer <email@hidden> wrote:
> Has anyone tried this? We have an SDK we're building, it has a library component, and a bundle which contains all the nib files, graphics, etc.
>
> I am trying to get a test set up to work on it.
>
> Originally, I was getting the 'symbol(s) not found for architecture i386' error on it, but after following some directions on the web <http://twobitlabs.com/2011/06/adding-ocunit-to-an-existing-ios-project-with-xcode-4>) I now have lots of errors! (82 to be precise).
>
> Anyone have some advice to try? Or is it just better to have the tests built into the app that's using the SDK?
>
> I think it's better to have the SDK tested separately, if possible.
>
_______________________________________________
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