-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testing: panicing test is reported as PASSing #5149
Labels
Milestone
Comments
What steps will reproduce the problem? If possible, include a link to a program on play.golang.org. 1. write a test method as following: func TestPanic(t *testing.T){ panic("a") t.Fail() } 2. run "go test -v" What is the expected output? report "--- Fail:" What do you see instead? report "--- PASS:" Which compiler are you using (5g, 6g, 8g, gccgo)? 6g Which operating system are you using? windows 7 sp1 Which version are you using? (run 'go version') devel +ff83e39f1348 |
A test that executes a raw panic will be marked as passing, although the entire test suite is correctly marked as failing. lucky(~/src/panic) % go test -v === RUN TestPanic --- PASS: TestPanic (0.00 seconds) panic: a [recovered] panic: a goroutine 3 [running]: testing.func·004() /home/dfc/go/src/pkg/testing/testing.go:341 +0xbc panic.TestPanic(0xc200075000) /home/dfc/src/panic/t_test.go:6 +0x53 testing.tRunner(0xc200075000, 0x5b0a20) /home/dfc/go/src/pkg/testing/testing.go:346 +0x8a created by testing.RunTests /home/dfc/go/src/pkg/testing/testing.go:426 +0x86b goroutine 1 [chan receive]: testing.RunTests(0x53a310, 0x5b0a20, 0x1, 0x1, 0x1, ...) /home/dfc/go/src/pkg/testing/testing.go:427 +0x88e testing.Main(0x53a310, 0x5b0a20, 0x1, 0x1, 0x5b8420, ...) /home/dfc/go/src/pkg/testing/testing.go:358 +0x8a main.main() panic/_test/_testmain.go:43 +0x9a exit status 2 FAIL panic 0.015s Labels changed: added priority-soon, go1.1maybe, removed priority-triage. Status changed to Accepted. |
My CL for this issue: https://golang.org/cl/8136043/ |
This issue was closed by revision 174a17e. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by coocood:
The text was updated successfully, but these errors were encountered: