emma maven 插件代码高亮
是否可以让输出 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要在
report
标记上设置sourcepath=
属性,并在html 标签,如果我没记错的话。You need to set the
sourcepath=
attribute on thereport
tag and you to specify at least(?) coveragedepth="method"
on the html tag if I remember correctly.我不知道这对于 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.
如果您运行
mvn emma:emma
或将其添加到
元素,这是 EMMA 插件的默认行为。 您可以在这里找到一个工作示例:http://github。 com/brettporter/centrepoint/blob/master/centrepoint/modules/pom.xmlThis 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