当我从TeamCity中的MSTest构建步骤调用dotCover时,构成完整代码覆盖的是什么? [英] What constitutes full code coverage when I invoke dotCover from an MSTest build step in TeamCity?

查看:237
本文介绍了当我从TeamCity中的MSTest构建步骤调用dotCover时,构成完整代码覆盖的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从TeamCity中的MSTest构建步骤调用dotCover时,什么是100%?是100%的所有编译代码?是测试所涉及的所有程序集的所有代码吗?是测试所触及的所有类吗?

What is considered 100% when I invoke dotCover from an MSTest build step in TeamCity? Is 100% all of the compiled code? Is it all the code for all the assemblies which the tests have touched? Is it all the classes which the tests have touched?

当我从运行My.Tests.dll的TeamCity MSTest构建步骤调用dotCover时,代码是跟踪?

When I invoke dotCover from a TeamCity MSTest build step which runs My.Tests.dll, which lines are code are being tracked?

推荐答案

dotCover仅提供语句级别覆盖报告,其中NCover等其他工具还包括函数和分支覆盖。

dotCover only provides reporting on statement-level coverage, where as other tools like NCover also include function and branch coverage.

使用TeamCity MSTest构建步骤,您可以在过滤器字段中指定要报告的数据包。这允许您只为 .Tests 模式指定排除或只包括一个程序集。有关详细信息,请参阅TeamCity文档:
http://confluence.jetbrains.net / display / TCD7 / JetBrains + dotCover

With a TeamCity MSTest build step you get to specify which assemblies you want the coverage reported for in the "Filters" field. This allows you to just specify an exclude for a .Tests pattern or just include one assembly. See the TeamCity documentation for more details: http://confluence.jetbrains.net/display/TCD7/JetBrains+dotCover

我相信如果你没有指定任何过滤器,那么所有程序集中所有加载到CLR (您必须从所调用的代码中导入程序集,因此可能不包括某些程序集,这只是CLR的延迟加载)。这是因为像dotCover这样的工具使用CLR性能分析API,并且不会预先测试代码。请注意,dotCover将从GAC中排除程序集。

I believe that if you don't specify any filters, all code in all assemblies that were loaded into the CLR are included (you have to cause an assembly load from the code you call, so some assemblies might not be included, this is just the lazily loading of the CLR). This is because tools like dotCover use the CLR profiling API and do not instrument your code upfront. Note that dotCover will exclude assemblies from the GAC.

这篇关于当我从TeamCity中的MSTest构建步骤调用dotCover时,构成完整代码覆盖的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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