OCMock.framework loading in unit test bundle

Discussion of the OCMock framework. If you have patches we would prefer you to send them to the mailing list, but attaching them to a topic is possible, too.

OCMock.framework loading in unit test bundle

Postby NSBum » 02 Oct 2012, 18:02

Can someone suggest a resource for integrating OCMock with Xcode 4.5 in a Cocoa (Mac OS) app?

Most of the weblog posts online have excellent discussions of adding OCMock to iOS apps wherein one adds the libOCMock.a and the public header files - and away you go.

However, the following steps in a Cocoa app fail:
    1. Xcode 4.5, Select Unit test target > Link Binary With Libraries > add OCMock.framework
    2. Setup copy files build phase to copy OCMock.framework to Frameworks directory
    3. Set copy frameworks (#2 above) to execute before Run Script build phase
    4. Product > Test
    5. Note tests succeed even with known failing tests. Build log transcript states:
    RunUnitTests exited without running because TEST_AFTER_BUILD was set to NO

    6. Repeat steps 1-4 after setting Test After Build to YES on unit test target results in build error:
    Test rig '/Applications/Xcode.app/Contents/Developer/Tools/otest' exited abnormally with code 5 (it may have crashed).


If someone will kindly point me in the right direction, I'd be happy to write up the documentation.
NSBum
 
Posts: 2
Joined: 02 Oct 2012, 17:46

Re: OCMock.framework loading in unit test bundle

Postby NSBum » 02 Oct 2012, 18:08

Solved:

The Runpath Search Paths setting on the unit test target should be
Code: Select all
@loader_path/../Frameworks
NSBum
 
Posts: 2
Joined: 02 Oct 2012, 17:46

Re: OCMock.framework loading in unit test bundle

Postby Guest » 23 Feb 2013, 13:27

Your post helped me greatly! I was missing the Copy Files phase and also the Runpath Search Paths setting.
Guest
 

Re: OCMock.framework loading in unit test bundle

Postby jonahwell » 29 Oct 2013, 14:07

Thanks for this response. Very useful.
jonahwell
 
Posts: 1
Joined: 29 Oct 2013, 14:01


Return to OCMock



cron