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:
Michael Lai
2019-09-18 17:31:51 -07:00
parent af01ea7f80
commit 6315b3013b
4 changed files with 153 additions and 4 deletions

View 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]