Installing in Mac OS X (Xcode 4)
To use GHUnit in your project, you’ll need to create and configure a test target.
- Add a
New Target. SelectApplication -> Cocoa Application. Name itTests(or something similar). - Copy and add
GHUnit.frameworkinto your project: Add Files to ‘App’…, selectGHUnit.framework, and select only the “Tests” target. - In the “Tests” target, in Build Settings, add
@loader_path/../FrameworkstoRunpath Search Paths. - In the “Tests” target, in Build Phases, select
Add Build Phaseand thenAdd Copy Files.- Change the Destination to
Frameworks. - Drag
GHUnit.frameworkfrom the project file view into the the Copy Files build phase. - Make sure the copy phase appears before any
Run Scriptphases.
- Change the Destination to
- Copy GHUnitTestMain.m into your project and include in the Test target. You should delete the existing main.m file (or replace the contents of the existing main.m with GHUnitTestMain.m).
- By default, the Tests-Info.plist file includes
MainMenuforMain nib file base name. You should clear this field. You can also delete the existing MainMenu.xib and files like TestsAppDelegate.*. - Now you can create and run tests!