mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-04-05 21:18:08 -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 (
|
import (
|
||||||
"bufio"
|
"bufio"
|
@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/jstemmer/go-junit-report/formatter"
|
||||||
"github.com/jstemmer/go-junit-report/parser"
|
"github.com/jstemmer/go-junit-report/parser"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -33,7 +34,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Write xml
|
// Write xml
|
||||||
err = JUnitReportXML(report, noXMLHeader, goVersionFlag, os.Stdout)
|
err = formatter.JUnitReportXML(report, noXMLHeader, goVersionFlag, os.Stdout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Error writing XML: %s\n", err)
|
fmt.Printf("Error writing XML: %s\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
@ -9,6 +9,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/jstemmer/go-junit-report/formatter"
|
||||||
"github.com/jstemmer/go-junit-report/parser"
|
"github.com/jstemmer/go-junit-report/parser"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -849,7 +850,7 @@ func testJUnitFormatter(t *testing.T, goVersion string) {
|
|||||||
|
|
||||||
var junitReport bytes.Buffer
|
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)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user