mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-04-05 05:00:15 -05:00
Go 1.1 or higher is required
This commit is contained in:
parent
2021749f03
commit
cea5308dd5
20
README.md
20
README.md
@ -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
|
||||
------------
|
||||
[](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
|
||||
|
||||
|
@ -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()
|
||||
|
@ -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
file_test.go:11: Longer
	error
	message.</failure>
|
||||
</testcase>
|
||||
<testcase classname="name" name="TestTwo" time="0.130"></testcase>
|
||||
</testsuite>
|
||||
|
Loading…
x
Reference in New Issue
Block a user