1.在xcode菜单Project->New Customer Executable..
取名如“otest",Path填”Developer/user/bin/otest”
[img]http://scottdensmore.typepad.com/pictures/General_UnitTests.png[/img]
2.右键Executables下新建的otest,选择“Get Info”,在Arguments下
加参数
-SenTest self
UnitTests.octest
UnitTests.octest为单元测试的bundle
再加环境变量
[table]
|Name| Value|
|DYLD_ROOT_PATH | $(SDKROOT)|
|DYLD_FRAMEWORK_PATH|{BUILD_PRODUCTS_DIR}:${SDK_ROOT}:${DYLD_FRAMEWORK_PATH}|
|IPHONE_SIMULATOR_ROOT | $(SDKROOT)|
|CFFIXED_USER_HOME | $(HOME)/Library/Application Support/iPhone Simulator/User/|
|OBJC_DISABLE_GC | YES|
|DYLD_LIBRARY_PATH|${BUILD_PRODUCTS_DIR}:${SDK_ROOT}:${DYLD_LIBRARY_PATH}|
| DYLD_NEW_LOCAL_SHARED_REGIONS | YES|
| DYLD_NO_FIX_PREBINDING | YES|
[/table]
[img]http://scottdensmore.typepad.com/pictures/Arguments_UnitTests.png[/img]
3.debug时选择otest,右键“Start otest With BreakPoint”
取名如“otest",Path填”Developer/user/bin/otest”
[img]http://scottdensmore.typepad.com/pictures/General_UnitTests.png[/img]
2.右键Executables下新建的otest,选择“Get Info”,在Arguments下
加参数
-SenTest self
UnitTests.octest
UnitTests.octest为单元测试的bundle
再加环境变量
[table]
|Name| Value|
|DYLD_ROOT_PATH | $(SDKROOT)|
|DYLD_FRAMEWORK_PATH|{BUILD_PRODUCTS_DIR}:${SDK_ROOT}:${DYLD_FRAMEWORK_PATH}|
|IPHONE_SIMULATOR_ROOT | $(SDKROOT)|
|CFFIXED_USER_HOME | $(HOME)/Library/Application Support/iPhone Simulator/User/|
|OBJC_DISABLE_GC | YES|
|DYLD_LIBRARY_PATH|${BUILD_PRODUCTS_DIR}:${SDK_ROOT}:${DYLD_LIBRARY_PATH}|
| DYLD_NEW_LOCAL_SHARED_REGIONS | YES|
| DYLD_NO_FIX_PREBINDING | YES|
[/table]
[img]http://scottdensmore.typepad.com/pictures/Arguments_UnitTests.png[/img]
3.debug时选择otest,右键“Start otest With BreakPoint”