emma maven 插件代码高亮

发布于 2024-07-25 15:46:54 字数 125 浏览 5 评论 0原文

是否可以让输出 html 报告突出显示 Maven 构建中覆盖的代码位置? 我知道你可以在独立的 emma 和 ant 中使用,但我还没有弄清楚如何使用 maven 和 emma 来做到这一点。 谢谢。

杰夫

is it possible to have the output html reports have highlighting where code was covered in a maven build? I know you can in standalone emma and with ant, but I haven't yet figured out how to do this with maven and emma. Thanks.

Jeff

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

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

发布评论

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

评论(3

从来不烧饼 2024-08-01 15:46:56

您需要在 report 标记上设置 sourcepath= 属性,并在html 标签,如果我没记错的话。

You need to set the sourcepath= attribute on the report tag and you to specify at least(?) coverage depth="method" on the html tag if I remember correctly.

跨年 2024-08-01 15:46:55

我不知道这对于 Emma Maven 插件是否可行,但这是 Cobertura Maven 插件。 它还为您提供了一条线被命中的次数,这对于确定您的测试最少的位置很有用。 请参阅此报告了解输出的示例。

我发现 Cobertura 和 Emma 在覆盖率检查方面很大程度上可以互换,只是在我看来 Cobertura 有更好的 Maven 插件,而 Emma 有更好的 Eclipse 插件。

I don't know if this is possible with the Emma Maven plugin, but this is the default behaviour for the Cobertura Maven plugin. It also gives you the number of times a line is hit, which can be useful in determining where your testing is minimal. See this report for an example of the output.

I find Cobertura and Emma to be largely interchangeable in terms of coverage checking, just that Cobertura has a better Maven plugin and Emma has a better Eclipse plugin in my opinion.

如梦亦如幻 2024-08-01 15:46:55

如果您运行 mvn emma:emma 或将其添加到 元素,这是 EMMA 插件的默认行为。 您可以在这里找到一个工作示例:http://github。 com/brettporter/centrepoint/blob/master/centrepoint/modules/pom.xml

This is the default behaviour of the EMMA plugin if you run mvn emma:emma or add it to the <reporting> element. You can find a working example here: http://github.com/brettporter/centrepoint/blob/master/centrepoint/modules/pom.xml

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