mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-04-05 05:00:15 -05:00
Merge pull request #68 from jmillikin-stripe/formatter-package
Move `junit-formatter.go` to its own package for use as a library.
This commit is contained in:
commit
2eb034df4e
@ -1,4 +1,4 @@
|
||||
package main
|
||||
package formatter
|
||||
|
||||
import (
|
||||
"bufio"
|
@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/jstemmer/go-junit-report/formatter"
|
||||
"github.com/jstemmer/go-junit-report/parser"
|
||||
)
|
||||
|
||||
@ -33,7 +34,7 @@ func main() {
|
||||
}
|
||||
|
||||
// Write xml
|
||||
err = JUnitReportXML(report, noXMLHeader, goVersionFlag, os.Stdout)
|
||||
err = formatter.JUnitReportXML(report, noXMLHeader, goVersionFlag, os.Stdout)
|
||||
if err != nil {
|
||||
fmt.Printf("Error writing XML: %s\n", err)
|
||||
os.Exit(1)
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/jstemmer/go-junit-report/formatter"
|
||||
"github.com/jstemmer/go-junit-report/parser"
|
||||
)
|
||||
|
||||
@ -849,7 +850,7 @@ func testJUnitFormatter(t *testing.T, goVersion string) {
|
||||
|
||||
var junitReport bytes.Buffer
|
||||
|
||||
if err = JUnitReportXML(testCase.report, testCase.noXMLHeader, goVersion, &junitReport); err != nil {
|
||||
if err = formatter.JUnitReportXML(testCase.report, testCase.noXMLHeader, goVersion, &junitReport); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user