You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
1.6.2
(installed via go1.6.2.linux-amd64.tar.gz at https://golang.org/dl/)
What operating system and processor architecture are you using (go env)?
The OS is Fedora 23 (Workstation Edition). The go env output doesn't quite capture that fully:
Run a simple test case that fails, outputting a t.Fatal(err).
What did you expect to see?
https://golang.org/pkg/testing/#T indicates that testing logs are accumulated and output to stderr so I expect the t.Fatal() output report to be on stderr.
What did you see instead?
The report output is on stdout.
It seems like something as trivial as tpepper@c60fccd (which is on top of tip's changes to allow subtests) could bring the report output in line with the documentation. But as noted in that tentative commit message, this might break users who have coded to the behavior without reporting the inconsistency. Perhaps the answer is to change the documentation, except the enabling the distinction between stdout and stderr is actually useful.
The text was updated successfully, but these errors were encountered:
tpepper
changed the title
testing:
testing: output to stderr as per docu instead of stdout
Jun 21, 2016
tpepper
changed the title
testing: output to stderr as per docu instead of stdout
testing: output failure report to stderr as per docu instead of stdout
Jun 21, 2016
./all.bash fails with my above referenced "fix", highlighting existing test cases are indeed coded to expect other than the documented behavior:
--- FAIL: TestVendorTest (0.13s)
go_test.go:244: running testgo [test -v]
go_test.go:259: standard output:
go_test.go:260: PASS
ok vend/hello 0.001s
go_test.go:263: standard error:
go_test.go:264: === RUN TestMsgInternal
--- PASS: TestMsgInternal (0.00s)
=== RUN TestMsgExternal
--- PASS: TestMsgExternal (0.00s)
go_test.go:349: missing use in internal test
go_test.go:350: pattern TestMsgInternal not found in standard output
FAIL
FAIL cmd/go 22.235s
tpepper@bf45959 trivially fixes the test case to match the fixed testing package. Then ./all.bash passes. But everything else in the golang universe might have failures.
Please answer these questions before submitting your issue. Thanks!
go version
)?1.6.2
(installed via go1.6.2.linux-amd64.tar.gz at https://golang.org/dl/)
go env
)?The OS is Fedora 23 (Workstation Edition). The
go env
output doesn't quite capture that fully:GOARCH="amd64"
GOBIN="/usr/src/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/usr/src/go"
GORACE=""
GOROOT="/usr/src/golang-1.6"
GOTOOLDIR="/usr/src/golang-1.6/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
go code https://play.golang.org/p/6GR6cTzVcM
go test case for that code https://play.golang.org/p/ZEJ2iNJMPV
Run a simple test case that fails, outputting a t.Fatal(err).
https://golang.org/pkg/testing/#T indicates that testing logs are accumulated and output to stderr so I expect the t.Fatal() output report to be on stderr.
The report output is on stdout.
It seems like something as trivial as tpepper@c60fccd (which is on top of tip's changes to allow subtests) could bring the report output in line with the documentation. But as noted in that tentative commit message, this might break users who have coded to the behavior without reporting the inconsistency. Perhaps the answer is to change the documentation, except the enabling the distinction between stdout and stderr is actually useful.
The text was updated successfully, but these errors were encountered: