rayh / xcoder

ruby wrapper for Xcode build tools to aid automating builds

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TEST_HOST Override Prevents Application Tests from Executing

blakewatters opened this issue · comments

With the recent refactoring the TEST_HOST='' override was reintroduced into the builder. If you are attempting to run a suite of application tests that must be injected into a host application this will prevent execution. It needs to be configurable to support logic and application tests.

What is the use case for overriding this value by default? I only see it appear once in the test suite. If not provided, it will inherit the value from the project which should be correct for either unit or logic test setup. Defaulting to $BUNDLE_LOADER would also work or all the projects I have xcoder integrated into, but curious what the reasoning is.

Ok, I think I didn't understand this one correctly before. TEST_HOST='' needs to be defined when running logic tests on iOS simulator (for some reason).

What are the situations when this needs to be NOT defined vs defined as a specific host vs defined as TEST_HOST. I was hoping that just setting TEST_HOST='' when :sdk => 'iphonesimulator' would be enough

So on my static library/framework projects when I review the Test Host setting on the OCUnit test bundle targets, the value is blank (as in no value, the setting header name is not bolded to indicate an override from the project level settings). The value of the Bundle Loader is also blank on these projects.

When I look at Applications that were created with testing targets configured, the Bundle Loader is set to the path of the built application product and TEST_HOST is set to $(BUNDLE_LOADER) because the unit testing bundle needs to be injected into the application to resolve symbols.

With the TEST_HOST='' line commented out, my static library/framework targets build and run tests just as before and the application tests now work because the TEST_HOST value hasn't been clobbered.

The real mystery to my mind is why you need an explicit definition of TEST_HOST for your logic tests to run. What is the value of Test Host on your target in the project being built?

Ok, so take a look at this issue #38

I'm not entirely sure, but I think the issue is with application
tests. I've got a spec for running tests and it seems to work when I
remove the TEST_HOST stuff, so I am trying to re-create the original
issue in a spec before changing anything else.

Also, take a look at

If you could add an example project/spec that shows this failure, that
would be much appreciated!

On 17 April 2012 13:48, Blake Watters
reply@reply.github.com
wrote:

So on my static library/framework projects when I review the Test Host setting on the OCUnit test bundle targets, the value is blank (as in no value, the setting header name is not bolded to indicate an override from the project level settings). The value of the Bundle Loader is also blank on these projects.

When I look at Applications that were created with testing targets configured, the Bundle Loader is set to the path of the built application product and TEST_HOST is set to $(BUNDLE_LOADER) because the unit testing bundle needs to be injected into the application to resolve symbols.

With the TEST_HOST='' line commented out, my static library/framework targets build and run tests just as before and the application tests now work because the TEST_HOST value hasn't been clobbered.

The real mystery to my mind is why you need an explicit definition of TEST_HOST for your logic tests to run. What is the value of Test Host on your target in the project being built?


Reply to this email directly or view it on GitHub:
#43 (comment)

Ray Hilton

a: 13/243 Collins Street, Melbourne VIC 3000
m: 0430 484 708
w: http://rayh.com.au

Ok, so for some reason, Xcode thinks that the unit tests are application tests and will refuse to run them unless TEST_HOST='':

xcodebuild -sdk iphonesimulator -project "/Users/ray/Projects/iOS Libraries/xcoder/spec/TestProject/TestProject.xcodeproj" -target "TestProjectTests" -configuration "Debug" OBJROOT="/Users/ray/Projects/iOS Libraries/xcoder/spec/TestProject/build/" SYMROOT="/Users/ray/Projects/iOS Libraries/xcoder/spec/TestProject/build/" TEST_AFTER_BUILD=YES

Returns:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Tools/Tools/RunPlatformUnitTests:95: warning: Skipping tests; the iPhoneSimulator platform does not currently support application-hosted tests (TEST_HOST set).

Ok, this is now resolved in 283027d by expecting the user to configure their TEST_HOST appropriately