我在Xcode 5.0中运行单元测试时遇到问题。 在日志中,每条消息都加倍,但使用断点检查显示每个测试都运行一次。
Test Suite 'Multiple Selected Tests' started at 2013-11-06 07:56:23 +0000
Test Suite 'Multiple Selected Tests' started at 2013-11-06 07:56:23 +0000
Test Suite 'ProjectTests.xctest' started at 2013-11-06 07:56:23 +0000
Test Suite 'ProjectTests.xctest' started at 2013-11-06 07:56:23 +0000
Test Suite 'ColorResourcesTests' started at 2013-11-06 07:56:23 +0000
Test Suite 'ColorResourcesTests' started at 2013-11-06 07:56:23 +0000
Test Case '-[ColorResourcesTests test_createDarkGrayColor_Should_ReturnDarkGray]' started.
Test Case '-[ColorResourcesTests test_createDarkGrayColor_Should_ReturnGray]' started.
Test Case '-[ColorResourcesTests test_createDarkGrayColor_Should_ReturnGray]' passed (0.000 seconds).
测试用例' - [ColorResourcesTests test_createDarkGrayColor_Should_ReturnGray]'通过(0.000秒)。
答案 0 :(得分:0)
我正在使用此问题的代码覆盖率修复stackoverflow.com/questions/19136767 / ...,问题出在 XCTestLogin 用户默认值。 (Generate gcda-files with Xcode5, iOS7 simulator and XCTest)
#ifdef DEBUG
+ (void)initialize {
[[NSUserDefaults standardUserDefaults] setValue:@"XCTestLog,GcovTestObserver"
forKey:@"XCTestObserverClass"];
}
#endif