Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/AlekSi/gocov-xml
https://github.com/AlekSi/gocov-xml
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/AlekSi/gocov-xml
- Owner: AlekSi
- License: mit
- Created: 2013-01-23T16:34:32.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2024-05-14T11:22:45.000Z (7 months ago)
- Last Synced: 2024-10-09T13:07:29.638Z (2 months ago)
- Language: Go
- Homepage:
- Size: 23.4 KB
- Stars: 144
- Watchers: 4
- Forks: 44
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - AlekSi/gocov-xml - (Go)
README
# gocov XML
A tool to generate Go coverage in XML report for using with tools/plugins like Jenkins/Cobertura.
> Table of Contents
- [gocov XML](#gocov-xml)
- [Installation](#installation)
- [Usage](#usage)
- [Examples](#examples)
- [Generate coverage by passing `gocov` output as input to `gocov-xml`](#generate-coverage-by-passing-gocov-output-as-input-to-gocov-xml)
- [Specifying optional source](#specifying-optional-source)
- [Authors](#authors)This is a simple helper tool for generating XML output in [Cobertura](http://cobertura.sourceforge.net/) format
for CIs like [Jenkins](https://wiki.jenkins-ci.org/display/JENKINS/Cobertura+Plugin), [vsts](https://www.visualstudio.com/team-services) and others
from [github.com/axw/gocov](https://github.com/axw/gocov) output.
The generated XML output is in the latest [coverage-04.dtd](http://cobertura.sourceforge.net/xml/coverage-04.dtd) schema## Installation
Just type the following to install the program and its dependencies:
For Go 1.17 and above:
```bash
go install github.com/axw/gocov/gocov@latest
go install github.com/AlekSi/gocov-xml@latest
```For previous Go versions:
```bash
go get github.com/axw/gocov/...
go get github.com/AlekSi/gocov-xml
```## Usage
> **NOTE**: `gocov-xml` reads data from the standard input.
```bash
gocov [-source ]
```Where,
- **`source`**: Absolute path to source. Defaults to the current working directory.
### Examples
#### Generate coverage by passing `gocov` output as input to `gocov-xml`
```bash
gocov test github.com/gorilla/mux | gocov-xml > coverage.xml
```#### Specifying optional source
```bash
gocov test github.com/gorilla/mux | gocov-xml -source /abs/path/to/source > coverage.xml
```## Authors
- [Alexey Palazhchenko (AlekSi)](https://github.com/AlekSi)
- [Yukinari Toyota (t-yuki)](https://github.com/t-yuki)
- [Marin Bek (marinbek)](https://github.com/marinbek)
- [Alex Castle (acastle)](https://github.com/acastle)
- [Billy Yao (yaoyaozong)](https://github.com/yaoyaozong)
- [Abhijith DA (abhijithda)](https://github.com/abhijithda)