【问题标题】:Hide XCTest Console Messages隐藏 XCTest 控制台消息
【发布时间】:2014-02-01 13:27:15
【问题描述】:

在 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
....

【问题讨论】:

    标签: xcode5 xctest


    【解决方案1】:

    编辑您的项目方案并取消选中您不想运行的测试类。选择Product > Scheme... > Edit Scheme...菜单项,在左侧栏中选择Test,取消勾选不相关的测试类:

    确保在以后需要它们时再次启用它们。如果取消选中所有测试类,Product > Test 菜单项(及其 Cmd-U 快捷方式)将被禁用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-06-25
      • 1970-01-01
      • 2016-04-18
      • 2022-06-30
      • 1970-01-01
      • 2019-11-02
      • 1970-01-01
      相关资源
      最近更新 更多