隐藏XCTest控制台消息

时间:2014-01-13 17:19:08

标签: xcode5 xctest

在Xcode 5中使用XCTest运行测试时,有没有办法禁用一些额外的控制台消息?每次运行测试时,Xcode都会打印出一些关于我没有运行的测试的无用行:

Test Suite 'xxxxViewTests' started at 2014-01-13 17:10:48 +0000
Test Suite 'xxxxViewTests' finished at 2014-01-13 17:10:48 +0000.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'yyyyyyViewTests' started at 2014-01-13 17:10:48 +0000
Test Suite 'yyyyyyViewTests' finished at 2014-01-13 17:10:48 +0000.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'zzzzzzzViewTests' started at 2014-01-13 17:10:48 +0000
Test Suite 'zzzzzzzViewTests' finished at 2014-01-13 17:10:48 +0000.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'xyxyViewTests' started at 2014-01-13 17:10:48 +0000
Test Suite 'xyxyViewTests' finished at 2014-01-13 17:10:48 +0000.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'xzxzxzScreenTests' started at 2014-01-13 17:10:48 +0000
Test Suite 'xzxzxzScreenTests' finished at 2014-01-13 17:10:48 +0000.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'yzyzyzyzyzTests' started at 2014-01-13 17:10:48 +0000
Test Suite 'yzyzyzyzyzTests' finished at 2014-01-13 17:10:48 +0000.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
....

1 个答案:

答案 0 :(得分:1)

编辑项目方案并取消选中您不想运行的测试类。选择产品>方案...>编辑方案... 菜单项,在左栏中选择测试,然后取消选中不相关的测试类:

enter image description here

请确保在以后需要时再次启用它们。如果您取消选中所有测试类,产品>

将禁用“测试”菜单项(及其Cmd-U快捷方式)