I have a XML file generated in a test. Is there a way to convert it to a HTML report ala Jenkins?
Is there a way to convert a Cobertura XML into an HTML report?
Asked Answered
pycobertura can take coverage.xml
and convert it into reasonable-looking HTML. I'm using it with some Erlang source code right now.
If you use Ant, you can use (notice 'format="html"'):
<cob:cobertura-report format="html" datafile="${cobertura.ser.file}" destdir="${todir}">
<fileset dir="${srcdir}" includes="**/*.java"/>
</cob:cobertura-report>
With a maven pom, refer to: the manual, e.g.:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<configuration>
<formats>
<format>html</format>
<!-- format>xml</format -->
</formats>
</configuration>
</plugin>
With a command-line script, refer to the manual too, e.g.:
cobertura-report.bat --format html --datafile C:\MyProject\build\cobertura.ser --destination C:\MyProject\reports\coverage C:\MyProject\src
What if the xml file is from lcov-to-cobertura or such? –
Icehouse
I would look into this python-based specific-purpose tool though I have not used it myself. –
Batts
I'm already using hat to create the cobertura.xml from gcov tests - what I need is a way to generate the HTML reports from the cobertura.xml file. –
Icehouse
Oh I see. Sorry I misread the question. I gave .ser->html, you're asking xml->html. I can't find anything for that, nor the reverse engineering of the xml file into .ser (xml->.ser) –
Batts
© 2022 - 2024 — McMap. All rights reserved.