mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-07-05 13:32:54 -05:00
parser/gotest: Handle build errors in test packages with _test suffix
It's possible for test files to declare a package with the "_test" suffix. If these packages contain build errors, they were not correctly matched to the package without the "_test" suffix. Refs #145
This commit is contained in:
11
testdata/038-report.xml
vendored
Normal file
11
testdata/038-report.xml
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuites tests="1" errors="1">
|
||||
<testsuite name="package/testpkg/pkg" tests="1" failures="0" errors="1" id="0" hostname="hostname" time="0.000" timestamp="2022-01-01T00:00:00Z">
|
||||
<properties>
|
||||
<property name="go.version" value="1.0"></property>
|
||||
</properties>
|
||||
<testcase name="[build failed]" classname="package/testpkg/pkg_test" time="0.000">
|
||||
<error message="Build error"><![CDATA[pkg/pkg_test.go:5:2: imported and not used: "fmt"]]></error>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
4
testdata/038-test-pkg-name.txt
vendored
Normal file
4
testdata/038-test-pkg-name.txt
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
# package/testpkg/pkg_test [package/testpkg/pkg.test]
|
||||
pkg/pkg_test.go:5:2: imported and not used: "fmt"
|
||||
FAIL package/testpkg/pkg [build failed]
|
||||
FAIL
|
Reference in New Issue
Block a user