gocover-cobertura (fork)
Forked because it was not possible to import and use the Cobertura Coverage definitions as a library.
- This fork moves the core functionalities of this tool to two packages
cobertura
and gocover
.
- Added a
go.mod
file to work with Go modules.
- I also changed the
class.NumLines()
function to count the list of lines in the class, instead of the length of all of its methods. This allows it to also work for parsing Cobertura coverage files generated with pytest
, while still working for Golang coverages, since the resulting Cobertura compatible XML already contains every source line as both lines and methods.
Fork author: Bart van Oort (bvobart)
Original ReadMe
This is a simple helper tool for generating XML output in Cobertura format
for CIs like Jenkins and others
from go tool cover output.
Installation
Just type the following to install the program and its dependencies:
$ go get code.google.com/p/go.tools/cmd/cover
$ go get github.com/t-yuki/gocover-cobertura
Usage
gocover-cobertura
reads from the standard input:
$ go test -coverprofile=coverage.txt -covermode count github.com/gorilla/mux
$ gocover-cobertura < coverage.txt > coverage.xml
Authors
Thanks
This tool is originated from gocov-xml by Alexey Palazhchenko (AlekSi)