如何在 TFS 中的构建中打开代码覆盖率? [英] How do you turn on Code Coverage in Builds within TFS?

查看:23
本文介绍了如何在 TFS 中的构建中打开代码覆盖率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在具有 .testrunco​​nfig 文件的解决方案上运行 TFS 构建时,我需要知道如何打开代码覆盖率.

I need to know how to turn on Code Coverage when running TFS builds on a solution with a .testrunconfig file.

testrunco​​nfig 文件中有一个用于代码覆盖率的选项,但是在运行 TFS 构建时没有代码覆盖率结果.

There is an option in the testrunconfig file that is for code coverage, but when running a TFS build there is no code coverage results.

我使用 *Tests.dll 掩码运行我的测试,而不是使用测试列表 (.vsmdi).

I am running my tests using the *Tests.dll mask and NOT using Test Lists (.vsmdi).

推荐答案

您如何运行测试?您是使用 .vsmdi 文件还是只是指定在 *Tests.dll 程序集中运行所有测试?

How are you running the tests? Are you using a .vsmdi file or just specifying that you run all tests in *Tests.dll assemblies?

如果是后者并且您使用的是 TFS 2008,那么您需要将以下内容添加到您的 TFSBuild.proj 文件中第一个 PropertyGroup 的 and 以进行构建.

If it is the latter and you are using TFS 2008, then you need to add the following to the and of the first PropertyGroup in your TFSBuild.proj file for the build.

<RunConfigFile>$(SolutionRoot)TestRunConfig.testrunconfig</RunConfigFile>

这会将构建指向您的 .testrunco​​nfig,以便它可以获取运行代码覆盖率的指令.

This points the build at your .testrunconfig so it can pick up the instructions to run code coverage.

这篇关于如何在 TFS 中的构建中打开代码覆盖率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆