Giter VIP home page Giter VIP logo

gocover-cobertura's Introduction

Forked from t-yuki

This is a fork of https://github.com/boumenot/gocover-cobertura.

At the time of this writing the repository appears to be on pause with several outstanding PRs, and forks with interesting contributions. This repo consolidates those outstanding forks, and combines them into one repo.

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 github.com/boumenot/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

Note that you should run this from the directory which holds your go.mod file.

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

  • -by-files

    Code coverage is organized by class by default. This flag organizes code coverage by the name of the file, which the same behavior as go tool cover.

  • -ignore-dirs PATTERN

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

    # A specific directory
    -ignore-dirs '^github\.com/boumenot/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/boumenot/gocover-cobertura/profile.go, examples of use:

    # A specific file
    -ignore-files '^github\.com/boumenot/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.

AuthorsMerger

Christopher Boumenot (boumenot)

Thanks

gocover-cobertura's People

Contributors

boumenot avatar darcysail avatar elliotmr avatar hansbogert avatar manemarron avatar mattn avatar maxatome avatar msabramo avatar skippyza avatar t-yuki avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.