Re: Testing iOS app code without launching the app
Re: Testing iOS app code without launching the app
- Subject: Re: Testing iOS app code without launching the app
- From: Rick Mann <email@hidden>
- Date: Thu, 25 Sep 2014 21:33:40 -0700
Thanks, Joar. I finally inferred that you have to remove the Test Host setting to get it to run the tests directly. But the docs aren't clear about that, especially in the section where they talk about the difference.
The problem I really had was link failures that weren't detected by the linker, but at run time. When I started adding the missing files to the test target, all hell broke loose (lots of dependencies). Now I'm struggling with a linker issue.
This stuff is still much harder than it should be.
On Sep 25, 2014, at 19:18 , Joar Wingfors <email@hidden> wrote:
>
> On 25 sep 2014, at 18:21, Rick Mann <email@hidden> wrote:
>
>> I want to test some portions of my iOS app code, but I don't want to launch the app and have it run normally. I tried removing the "TestHost" setting, and my test case code is called, but I get a lot of complaint in the console:
>>
> <snip>
>>
>> The XCTest docs talk about app-vs-library tests, but the bit about the bundle loading is buried in "Running Tests and Viewing Results", and none of it is clear on how to properly set up the two different kinds of tests.
>>
>> How do I do this?
>
>
> Tests are executed inside of some process (obviously), this process is referred to as the test "host". This process can be an app (typically *your* app), or in certain special cases it can also be a special command line utility that Xcode provides. For many different reasons that I won't go into here, it's very much recommended that you choose to host your tests inside of an application. If you don't have an application (your product is a framework / library), or if you don't want to use your own application for whatever reason, you can create a new application to be the test host.
>
> To do this, just add a new app target to your project. Make sure that the app target and the test targets of your choice are included in the scheme that you want to use when running your tests. Done.
>
> Joar
>
>
>
> _______________________________________________
> 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
--
Rick Mann
email@hidden
_______________________________________________
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