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:
Joël Stemmer 2018-03-17 19:41:40 +00:00 committed by GitHub
commit 2eb034df4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,4 @@
package main
package formatter
import (
"bufio"

View File

@ -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)

View File

@ -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)
}