GHUnit for Xcode 3

To use GHUnit in your project, you’ll need to create and configure a test target.

  • Add a New Target. Select Cocoa -> Application. Name it Tests (or something similar).
  • In the Finder, copy GHUnit.framework to your project directory (maybe in MyProject/Frameworks/.)
  • In the Tests target, add the GHUnit.framework files (from MyProject/Frameworks/). It should now be visible as a Linked Framework in the target.
  • In the Tests target, under Build Settings, add @loader_path/../Frameworks to Runpath Search Paths (Under All Configurations)
  • In the Tests target, add New Build Phase | New Copy Files Build Phase.
    • Change the Destination to Frameworks.
    • Drag GHUnit.framework into the the build phase
    • Make sure the copy phase appears before any Run Script phases
  • Copy GHUnitTestMain.m into your project and include in the Test target.

  • If your main target is a library:

    • In the Target 'Tests' Info window, General tab:
      • Add a linked library, and select your main target; This is so you can link your test target against your main target, and then you don’t have to manually include source files in both targets.
  • If your main target is an application, you will need to include these source files to the Test project manually.

  • Now create a test (either by subclassing SenTestCase or GHTestCase), adding it to your test target. (See example test case below.)

  • By default, the Tests-Info.plist file includes MainWindow for Main nib file base name. You should clear this field.
  • Now you can create and run tests!
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值