有没有办法将Cobertura XML转换为HTML报告?

时间:2013-04-02 17:55:05

标签: code-coverage cobertura

我在测试中生成了一个XML文件。有没有办法将它转换为HTML报告ala Jenkins?

2 个答案:

答案 0 :(得分:1)

pycobertura可以使用coverage.xml并将其转换为外观合理的HTML。我现在正在将其与一些Erlang源代码一起使用。

答案 1 :(得分:0)

如果你使用Ant,你可以使用(注意'format =“ html ”'):

<cob:cobertura-report format="html" datafile="${cobertura.ser.file}" destdir="${todir}">
     <fileset dir="${srcdir}" includes="**/*.java"/>
</cob:cobertura-report>

使用maven pom,请参阅:the manual,例如:

<plugin>
   <groupId>org.codehaus.mojo</groupId>
   <artifactId>cobertura-maven-plugin</artifactId>
   <configuration>
     <formats>
       <format>html</format>
       <!-- format>xml</format -->
     </formats>
   </configuration>
</plugin>

使用命令行脚本,也可以参考the manual,例如:

cobertura-report.bat --format html --datafile C:\MyProject\build\cobertura.ser --destination C:\MyProject\reports\coverage C:\MyProject\src