0

我在 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 秒)。

4

1 回答 1

0

我正在使用这个问题 stackoverflow.com/questions/19136767/... 中的代码覆盖修复,问题出在 XCTestLogin用户默认值上。(使用 Xcode5、iOS7 模拟器和 XCTest 生成 gcda 文件

#ifdef DEBUG
    + (void)initialize {
        [[NSUserDefaults standardUserDefaults] setValue:@"XCTestLog,GcovTestObserver"
                                                 forKey:@"XCTestObserverClass"];
    }
#endif
于 2013-11-06T10:21:17.023 回答