A tool to generate Go coverage in XML report for using with tools/plugins like Jenkins/Cobertura.
Table of Contents
This is a simple helper tool for generating XML output in Cobertura format for CIs like Jenkins, vsts and others from github.com/axw/gocov output. The generated XML output is in the latest coverage-04.dtd schema
Just type the following to install the program and its dependencies:
For Go 1.17 and above:
go install github.com/axw/gocov/gocov@latest
go install github.com/AlekSi/gocov-xml@latestFor previous Go versions:
go get github.com/axw/gocov/...
go get github.com/AlekSi/gocov-xmlNOTE:
gocov-xmlreads data from the standard input.
gocov [-source <absolute path to source>]Where,
source: Absolute path to source. Defaults to the current working directory.
gocov test github.com/gorilla/mux | gocov-xml > coverage.xmlgocov test github.com/gorilla/mux | gocov-xml -source /abs/path/to/source > coverage.xml