如何清除 Xcode 中的单元测试结果?

发布于 2024-11-16 05:31:06 字数 146 浏览 4 评论 0原文

我在 Xcode 4 中清除单元测试的测试结果时遇到问题。基本上,我运行的单元测试会产生正常的警告。但是,当我切换到常规捆绑包并运行构建时,单元测试结果仍然存在。

有什么方法可以从问题导航器中清除它们吗?

基本上,我想要一种清除问题导航器的方法。

I'm having trouble clearing the test results for unit tests in Xcode 4. Basically, I ran a unit test which results in normal warnings. But, when I switch to regular bundle and run a build, the unit test results are still sticking around.

Is there any way to clear them from the Issue Navigator?

Basically, I want a way to clear the Issue Navigator.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

够钟 2024-11-23 05:31:06

编写 Kiwi BDD 测试后,我必须完全关闭我的项目并重新打开它以清除测试导航器中的测试用例。

After writing Kiwi BDD tests I have to completely close my project and reopen it to clear test cases in the Test navigator.

子栖 2024-11-23 05:31:06

从 Xcode 12.5 开始,“产品”菜单下有一个名为“清理测试结果”的新菜单项,默认键盘快捷键为 control-option-command-K。这将从所有测试中清除红色/绿色徽章。

Xcode 屏幕截图13.4.1 显示产品->清洁测试结果菜单选项

As of Xcode 12.5, there's a new menu item under the Product menu called Clean Test Results with a default keyboard shortcut of control-option-command-K. That will clear the red/green badges from all tests.

Screenshot of Xcode 13.4.1 showing Product->Clean Test Results menu option

看海 2024-11-23 05:31:06

回答我自己的问题。看来您必须切换回单元测试方案,清除构建文件夹,然后切换回项目以防止问题再次出现。

To answer my own question. It appears you have to switch back to the Unit Test scheme, clear the build folder, then switch back to the project to keep the issues from popping back up.

墨落成白 2024-11-23 05:31:06

删除 ~/Library/Developer/Xcode/DerivedData//Logs/Test 中的所有日志

在此处输入图像描述

PS:最简单的快捷方式Xcode 中的文件夹为:

  • 转到“Report Navigator”(左侧面板中的最后一个选项卡)
  • 右键单击以“Test”或“Log”或“覆盖范围”
  • 选择“在 Finder 中显示”。

在此处输入图像描述

Delete all the logs in ~/Library/Developer/Xcode/DerivedData/<project>/Logs/Test

enter image description here

PS: the easiest way to shortcut to this folder within Xcode is:

  • goto the "Report Navigator" (last tab in the panel on the left)
  • right click an entry that begins "Test" or "Log" or "Coverage"
  • chose "Show in Finder".

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文