简体   繁体   中英

Trouble Adding OCUnit Testing Framework to Existing Xcode Project

I am trying to integrate Unit Tests in my current Xcode project using the OCUnit Testing Framework. I have been following Apple's documentation:

http://developer.apple.com/library/mac/#documentation/developertools/Conceptual/UnitTesting/02-Setting_Up_Unit_Tests_in_a_Project/setting_up.html ,

regarding setting up Logic Tests. When I switch to my testing scheme and run 'Test' under the 'Product' tab, I am receive two errors:

Error 1: Undefined symbols for architecture i386: "_main", referenced from: start in crt1.o

Error 2: ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've tried cleaning my build and also using application tests but nothing seems to work. The tutorials I've views on Lynda seems not to run into these errors. Adding a target and linking it to my current project seems like all that needs to happen in order to start utilizing Unit Tests within Xcode. What do these errors mean and what do they refer to? All input is appreciated!

1) Create a new iOS project say one view controller type, and specify you want unit tests at creation, now you can see how Xcode has wired it - you will have a reference.

2) create a new project of the type and name as your current one in a temp folder. Move your original project file to another temp folder, move the new one to where original one was, then import all files checking unit test target.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM