我試圖單元測試添加到我的項目,這裏是我在做什麼:iPhone XCode的單元測試框架的構建設置
添加目標 - >可可觸摸單元測試包
product
:AuthyTests
company Identifier:
com.authy.com
project
:authy所以所得到的捆綁標識符是:com.authy.AuthyTests
如果我運行命令+ U(產品 - >測試)它工作單元測試運行。
現在,我從我的項目中添加一個庫,以便#包括 「otp.h」 AuthyTests.h
添加一些調用AuthyTest.m(
[Otp foo];
),我得到一個錯誤:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_Otp", referenced from:
objc-class-ref in AuthyTests.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
事情我已經嘗試:
1.I嘗試添加authy.app作爲AuthyAppTests的TargetDependencies依賴構建階段。
2.Targets - > AuthyTests - > BuildSettings - >只能建活動Architechture - >是
我使用的Xcode 4.2。我也試過這個網站上的所有內容:
http://twobitlabs.com/2011/06/adding-ocunit-to-an-existing-ios-project-with-xcode-4/
我缺少的是對建立單元測試上的XCode?
事實證明,步驟4導致文件丟失錯誤(我們仍然可以找到文件系統中奇怪的文件)。今晚晚些時候我們會再試一次......並且回報,謝謝 – daniel