File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,10 @@ func ingestTestcase(root xmlNode) Test {
8080case "error" :
8181test .Error = ingestError (node )
8282test .Status = StatusError
83+ case "system-out" :
84+ test .SystemOut = string (node .Content )
85+ case "system-err" :
86+ test .SystemErr = string (node .Content )
8387}
8488}
8589
Original file line number Diff line number Diff line change @@ -11,15 +11,20 @@ import (
1111"github.com/stretchr/testify/require"
1212)
1313
14- func TestInjest (t * testing.T ) {
14+ func TestIngest (t * testing.T ) {
1515tests := []struct {
1616title string
1717input []byte
1818expected []Suite
1919}{
2020{
2121title : "xml input" ,
22- input : []byte (`<testsuite errors="0" failures="1" file="Foo.java"><testcase name="unit tests" file="Foo.java"/></testsuite>` ),
22+ input : []byte (`<testsuite errors="0" failures="1" file="Foo.java">
23+ <testcase name="unit tests" file="Foo.java">
24+ <system-out><![CDATA[Hello, World]]></system-out>
25+ <system-err><![CDATA[I'm an error!]]></system-err>
26+ </testcase>
27+ </testsuite>` ),
2328expected : []Suite {
2429{
2530Tests : []Test {
@@ -30,6 +35,8 @@ func TestInjest(t *testing.T) {
3035"file" : "Foo.java" ,
3136"name" : "unit tests" ,
3237},
38+ SystemOut : "Hello, World" ,
39+ SystemErr : "I'm an error!" ,
3340},
3441},
3542Totals : Totals {
Original file line number Diff line number Diff line change @@ -129,6 +129,14 @@ type Test struct {
129129// Additional properties from XML node attributes.
130130// Some tools use them to store additional information about test location.
131131Properties map [string ]string `json:"properties" yaml:"properties"`
132+
133+ // SystemOut is textual output for the test case. Usually output that is
134+ // written to stdout.
135+ SystemOut string `json:"stdout,omitempty" yaml:"stdout,omitempty"`
136+
137+ // SystemErr is textual error output for the test case. Usually output that is
138+ // written to stderr.
139+ SystemErr string `json:"stderr,omitempty" yaml:"stderr,omitempty"`
132140}
133141
134142// Error represents an erroneous test result.
You can’t perform that action at this time.
0 commit comments