我正试图深入探讨使用
Xcode进行单元测试的相当坦率的可怕世界(这似乎是一个错综复杂的过程.)
基本上我有这个测试类,试图测试我的Show.h类
#import <GHUnit/GHUnit.h> #import "Show.h" @interface ShowTest : GHTestCase { } @end @implementation ShowTest - (void)testShowCreate { Show *s = [[Show alloc] init]; GHAssertNotNil(s,@"Was nil."); } @end
但是,当我尝试构建并运行我的测试时,它会因此错误而呻吟: –
Undefined symbols:
“_OBJC_CLASS_$_Show”,referenced from:
06001
ld: symbol(s) not found
collect2: ld returned 1 exit status
现在我假设这是一个链接错误.我尝试按照此处说明中的每一步操作: –
http://github.com/gabriel/gh-unit/blob/master/README.md
这些说明的第2步让我困惑: –
In the Target ‘Tests’ Info window,General tab:
Add a linked library,under Mac OS X 10.5 SDK section,select GHUnit.framework
Add a linked library,select your project.
Add a direct dependency,and select your project. (This will cause your application or framework to build before the test target.)