有谁知道如何在app扩展目标上执行单元测试,尤其是键盘扩展目标?
我尝试了什么(在单元测试目标中):
$(BUILT_PRODUCTS_DIR)/com.mycompany.keyboard.appex/com.mycompany.keyboard$(BUNDLE_LOADER).完成这些操作后,我可以成功构建它,但始终会使用日志获得"测试失败" Test target SogouInputTests encountered an error (Test session exited(1). without checking in. If you believe this error represents a bug, please attach the log file at /tmp/TestStatus-UXfvxw.log).
我正在使用Xcode 6 beta 3.
我在XCode 4中使用单元测试创建了一个新的Cocoa Touch静态库项目,并添加了一个类别:
// NSString+Inflections.h
@interface NSString (Inflections)
- (NSString *)pluralize;
@end
// NSString+Inflections.m
@implementation NSString (Inflections)
- (NSString *)pluralize { return self; }
@end
Run Code Online (Sandbox Code Playgroud)
然后在我的测试用例中添加了相应的import语句并编写了以下测试:
- (void)testPluralize
{
NSString *test = @"person";
NSString *expected = @"people";
NSString *actual = [test pluralize];
STAssertEqualObjects(actual, expected, @"Whoops");
}
Run Code Online (Sandbox Code Playgroud)
但是,这会导致我的测试在'无法识别的选择器发送到实例'时崩溃(而不是失败).
如何测试库中的类别?
我已经压缩并上传了完整的项目在这里,如果我的描述是不够的.