---
title: "Discussion on \"在SwiftPM中运行Test小纸条\" | Hashnode"
description: "Discussion on \"在SwiftPM中运行Test小纸条\". 我是一个喜欢用Unit Test进行调试和自动化测试的人。最近开始使用SwiftPM将代码模块化，把UnitTest移到SwiftPM中后运行Tests会发现出现这样的提示：\n\n解决方法就是将这个SwiftPM加入到配置里去，先选择edit scheme：\n\n在Test的列表下点+号：\n\n找到你想要加入scheme中的项目，选中按Add：\n\n新加入的项目就会出现在列表中了，而且默认就是Enabled的状态。\n再去项目里点击运行测试，一切就正常了："
url: "https://hashnode.com/posts/swiftpm-unittest/6246efcdc794c505604c30a7"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [在SwiftPM中运行Test小纸条](https://blog.hdcola.org/swiftpm-unittest?utm_source=hashnode&utm_medium=feed)

我是一个喜欢用Unit Test进行调试和自动化测试的人。最近开始使用SwiftPM将代码模块化，把UnitTest移到SwiftPM中后运行Tests会发现出现这样的提示： 解决方法就是将这个SwiftPM加入到配置里去，先选择edit scheme： 在Test的列表下点+号： 找到你想要加入scheme中的项目，选中按Add： 新加入的项目就会出现在列表中了，而且默认就是Enabled的状态。 再去项目里点击运行测试，一切就正常了：

Apr 1, 2022 · 1 min read · blog.hdcola.org  
Read the article

-   [#ios-app-development](https://hashnode.com/tag/ios-app-development)
-   [#xcode](https://hashnode.com/tag/xcode)
-   [#swift](https://hashnode.com/tag/swift)

## Written by

[老房东](https://hashnode.com/@hdcola)

@hdcola · Quebec CA

  
[View profile](https://hashnode.com/@hdcola)

Let's enjoy life

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
