如何在每个构建上自动执行单元测试?

How do I automatically perform unit tests on each build?(如何在每个构建上自动执行单元测试?)

本文介绍了如何在每个构建上自动执行单元测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在每个构建上自动执行单元测试?

How do I automatically perform unit tests on each build?

我尝试将单元测试目标作为依赖项添加到项目目标中,但这似乎无法运行实际测试.

I tried to add the Unit Tests target to the Project Target as a dependency, but that doesn't seem to run the actual tests.

推荐答案

将 Test After Build 构建设置设置为 Yes.选择 Product > Build For > Build For Testing 来构建项目并运行测试.

Set the Test After Build build setting to Yes. Choose Product > Build For > Build For Testing to build the project and run the tests.

Xcode 5 更新

Xcode 5 不支持 Test After Build 构建设置.我不知道有什么方法可以在 Xcode 5 中对每个构建自动运行测试.从 OS X 菜单栏中选择 Product > Test 或按 Command + u 在 Xcode 5 中运行单元测试.

Xcode 5 does not support the Test After Build build setting. I don't know of any way to automatically run tests on each build in Xcode 5. From the OS X menu bar choose Product > Test or press Command + u to run unit tests in Xcode 5.

这篇关于如何在每个构建上自动执行单元测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何在每个构建上自动执行单元测试?

基础教程推荐