Skip to content

maxatome/gocover-cobertura

 
 

Repository files navigation

Build Status Coverage Status

go tool cover XML (Cobertura) export

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

Some flags can be passed (each flag should only be used once):

  • -ignore-dirs PATTERN

    ignore directories matching PATTERN regular expression. Full directory names are matched, as github.com/t-yuki/gocover-cobertura (and so github.com/t-yuki and github.com), examples of use:

    # A specific directory
    -ignore-dirs '^github\.com/t-yuki/gocover-cobertura/testdata$'
    # All directories autogen and any of their subdirs
    -ignore-dirs '/autogen$'
    
  • -ignore-files PATTERN

    ignore files matching PATTERN regular expression. Full file names are matched, as github.com/t-yuki/gocover-cobertura/profile.go, examples of use:

    # A specific file
    -ignore-files '^github\.com/t-yuki/gocover-cobertura/profile\.go$'
    # All files ending with _gen.go
    -ignore-files '_gen\.go$'
    # All files in a directory autogen (or any of its subdirs)
    -ignore-files '/autogen/'
    
  • -ignore-gen-files

    ignore generated files. Typically files containing a comment indicating that the file has been automatically generated. See genCodeRe regexp in ignore.go.

Authors

Thanks

This tool is originated from gocov-xml by Alexey Palazhchenko (AlekSi)

About

golang : go tool cover to XML (Cobertura) export tool.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%