Go 1.1 or higher is required

This commit is contained in:
Joël Stemmer 2014-10-24 21:44:19 +02:00
parent 2021749f03
commit cea5308dd5
3 changed files with 15 additions and 13 deletions

View File

@ -1,16 +1,22 @@
go-junit-report
===============
# go-junit-report
Converts `go test` output to an xml report, suitable for applications that
expect junit xml reports (e.g. [Jenkins](http://jenkins-ci.org)).
Installation
------------
[![Build Status](https://travis-ci.org/jstemmer/go-junit-report.svg)](https://travis-ci.org/jstemmer/go-junit-report)
go get github.com/jstemmer/go-junit-report
Usage
-----
## Installation
Go version 1.1 or higher is required. Install or update using the `go get`
command:
go get -u github.com/jstemmer/go-junit-report
## Usage
go-junit-report reads the `go test` verbose output from standard in and writes
junit compatible XML to standard out.
go test -v | go-junit-report > report.xml

View File

@ -102,8 +102,7 @@ func JUnitReportXML(report *Report, w io.Writer) error {
writer := bufio.NewWriter(w)
// remove newline from xml.Header, because xml.MarshalIndent starts with a newline
writer.WriteString(xml.Header[:len(xml.Header)-1])
writer.WriteString(xml.Header)
writer.Write(bytes)
writer.WriteByte('\n')
writer.Flush()

View File

@ -4,10 +4,7 @@
<property name="go.version" value="1.0"></property>
</properties>
<testcase classname="name" name="TestOne" time="0.020">
<failure message="Failed" type="">file_test.go:11: Error message
file_test.go:11: Longer
error
message.</failure>
<failure message="Failed" type="">file_test.go:11: Error message&#xA;file_test.go:11: Longer&#xA;&#x9;error&#xA;&#x9;message.</failure>
</testcase>
<testcase classname="name" name="TestTwo" time="0.130"></testcase>
</testsuite>