mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-07-04 05:02:47 -05:00
Parse package name output when test binary name is included
Sometimes, the text after "# " shows the name of the test binary ("<package>.test") in addition to the package e.g.: "# package/name [package/name.test]". This change ensures that the packages' build outputs are associated correctly in this case.
This commit is contained in:
39
testdata/31-report.xml
vendored
Normal file
39
testdata/31-report.xml
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuites>
|
||||
<testsuite tests="1" failures="0" time="0.100" name="package/name/passing1">
|
||||
<properties>
|
||||
<property name="go.version" value="1.0"></property>
|
||||
</properties>
|
||||
<testcase classname="passing1" name="TestA" time="0.100"></testcase>
|
||||
</testsuite>
|
||||
<testsuite tests="1" failures="0" time="0.100" name="package/name/passing2">
|
||||
<properties>
|
||||
<property name="go.version" value="1.0"></property>
|
||||
</properties>
|
||||
<testcase classname="passing2" name="TestB" time="0.100"></testcase>
|
||||
</testsuite>
|
||||
<testsuite tests="1" failures="1" time="0.000" name="package/name/failing1">
|
||||
<properties>
|
||||
<property name="go.version" value="1.0"></property>
|
||||
</properties>
|
||||
<testcase classname="failing1" name="[build failed]" time="0.000">
|
||||
<failure message="Failed" type="">failing1/failing_test.go:15: undefined: x</failure>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
<testsuite tests="1" failures="1" time="0.000" name="package/name/failing2">
|
||||
<properties>
|
||||
<property name="go.version" value="1.0"></property>
|
||||
</properties>
|
||||
<testcase classname="failing2" name="[build failed]" time="0.000">
|
||||
<failure message="Failed" type="">failing2/another_failing_test.go:20: undefined: y</failure>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
<testsuite tests="1" failures="1" time="0.000" name="package/name/setupfailing1">
|
||||
<properties>
|
||||
<property name="go.version" value="1.0"></property>
|
||||
</properties>
|
||||
<testcase classname="setupfailing1" name="[setup failed]" time="0.000">
|
||||
<failure message="Failed" type="">setupfailing1/failing_test.go:4: cannot find package "other/package" in any of:
	/path/vendor (vendor tree)
	/path/go/root (from $GOROOT)
	/path/go/path (from $GOPATH)</failure>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
20
testdata/31-syntax-error-test-binary.txt
vendored
Normal file
20
testdata/31-syntax-error-test-binary.txt
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
# package/name/failing1 [package/name/failing1.test]
|
||||
failing1/failing_test.go:15: undefined: x
|
||||
# package/name/failing2 [package/name/failing2.test]
|
||||
failing2/another_failing_test.go:20: undefined: y
|
||||
# package/name/setupfailing1 [package/name/setupfailing1.test]
|
||||
setupfailing1/failing_test.go:4: cannot find package "other/package" in any of:
|
||||
/path/vendor (vendor tree)
|
||||
/path/go/root (from $GOROOT)
|
||||
/path/go/path (from $GOPATH)
|
||||
=== RUN TestA
|
||||
--- PASS: TestA (0.10 seconds)
|
||||
PASS
|
||||
ok package/name/passing1 0.100s
|
||||
=== RUN TestB
|
||||
--- PASS: TestB (0.10 seconds)
|
||||
PASS
|
||||
ok package/name/passing2 0.100s
|
||||
FAIL package/name/failing1 [build failed]
|
||||
FAIL package/name/failing2 [build failed]
|
||||
FAIL package/name/setupfailing1 [setup failed]
|
Reference in New Issue
Block a user