2013-04-02 81 views

回答

0

如果你使用Ant,你可以使用(通知书 '格式= “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 
+0

如果xml文件来自lcov-to-cobertura或者这样的话会怎么样? – Penz

+0

我想看看这个基于python的[特定目的工具](http://eriwen.github.io/lcov-to-cobertura-xml/),尽管我自己并没有使用它。 –

+4

我已经使用帽子来创建gcov测试中的cobertura.xml - 我需要的是一种从cobertura.xml文件生成HTML报告的方法。 – Penz

相关问题