Ncover 未覆盖程序集?

发布于 2024-08-09 17:01:47 字数 1012 浏览 7 评论 0原文

我无法让 NCover 正确覆盖 .dll。我有几个使用 XUnit.NETSubSpec 执行 BDD 风格的规范。除其中一个测试套件外,所有测试套件都可以在 TestDriven.NET (1.5.8) 附带的 NCover 版本中完美运行。然而,我有一个拒绝分析实际测试的组件的情况。我已验证 /a 选项的程序集名称正确,.pdb 文件存在,并且执行期间没有抛出异常。 8 个测试全部通过,这可以在执行 NCover 控制台应用程序时看到。

该程序集引用 WPF 程序集 PresentationCorePresentationFrameworkWindowsBase。我不确定这是否会导致问题,但我对 NCover 拒绝分析此程序集感到完全困惑。

命令行:

"C:\Program Files (x86)\TestDriven.NET 2.0\NCover\1.5.8\NCover.Console.exe" //reg //w "E:\Campus.Core\Specs.Campus.Windows\bin\Debug" //a Campus.Windows "E:\Campus.Core\ThirdParty\xUnit.NET\v1.5\xunit.console.x86.exe" Specs.Campus.Windows.dll /html Specs.Campus.Windows.html

注意:

问题似乎已自行解决!我不知道发生了什么变化,但程序集现在被正确覆盖,并且覆盖率为 100%!感谢那些提出意见的人。我很感激!

I am having trouble getting NCover to properly cover a .dll. I have several test projects that use XUnit.NET and SubSpec to execute BDD-style specifications. All but one of these test suites runs perfectly in the version of NCover that comes with TestDriven.NET (1.5.8). However, I have one that refused to profile the actual tested assembly. I have verified that the assembly names for the /a option are correct, that the .pdb file exists, and that there are no exceptions being thrown during execution. All of the 8 tests pass, which can be seen when the NCover console app is executed.

The assembly references the WPF assemblies PresentationCore, PresentationFramework and WindowsBase. I am not sure if that might be causing problems, but I am completely baffled by NCover's refusal to profile this assembly.

Command line:

"C:\Program Files (x86)\TestDriven.NET 2.0\NCover\1.5.8\NCover.Console.exe" //reg //w "E:\Campus.Core\Specs.Campus.Windows\bin\Debug" //a Campus.Windows "E:\Campus.Core\ThirdParty\xUnit.NET\v1.5\xunit.console.x86.exe" Specs.Campus.Windows.dll /html Specs.Campus.Windows.html

NOTE:

Problem seems to have solved itself! I don't know what changed, but the assembly is now being covered properly, and its at 100% coverage! Thanks for those of you who threw in some input. I appreciate it!

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

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

发布评论

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

评论(3

原谅我要高飞 2024-08-16 17:01:47

我不确定 v1.5.8 是如何工作的,但你确定 dll 已加载到内存中吗?

你确定pdb与dll匹配吗?每隔一段时间,dll 就会与 pdb 不同步。它是在同一台机器上构建的吗?

大会的名称是什么?查看 app.config 文件并查看是否有系统排除项。

如果您正在使用 NCover 3,请随时联系支持人员,他们会为您提供帮助。

谢谢

乔·费瑟

I am not sure how v1.5.8 works but are you sure the dll is loaded into memory?

Are you sure the pdb matches the dll? Every once in awhile, the dll is not in sync with the pdb. Was it built on the same machine?

What is the name of the assembly? Look in the app.config file and see if there are system exclusions.

If you are using NCover 3, feel free to contact support, they will help you out.

Thanks

Joe Feser

带刺的爱情 2024-08-16 17:01:47

ncover 1.5.8 在其 app.config 文件中有一个自动排除的程序集列表。也许其中之一就是排除你的集会?

ncover 1.5.8 has a list of auto-excluded assemblies in its app.config file. perhaps one of those is excluding your assembly?

潦草背影 2024-08-16 17:01:47

问题似乎已经自行解决了!我不知道发生了什么变化,但程序集现在被正确覆盖,并且覆盖率为 100%!感谢那些提出意见的人。我很感激!

Problem seems to have solved itself! I don't know what changed, but the assembly is now being covered properly, and its at 100% coverage! Thanks for those of you who threw in some input. I appreciate it!

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