Skip to content

Commit

Permalink
Make sure failed tests report their exit code (#240)
Browse files Browse the repository at this point in the history
Commit 72c1660 introduced TestMain, but forgot to call os.Exit with the value returned from m.Run  This causes "go test" to exit with status 0, even if tests fail.  Adding os.Exit to TestMain makes sure the success/failure of tests is correctly reported through the exit code.
  • Loading branch information
mndrix authored Apr 24, 2021
1 parent 8e7d633 commit 126f21b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quick_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestMain(m *testing.M) {
fmt.Fprintln(os.Stderr, "seed:", qseed)
fmt.Fprintf(os.Stderr, "quick settings: count=%v, items=%v, ksize=%v, vsize=%v\n", qcount, qmaxitems, qmaxksize, qmaxvsize)

m.Run()
os.Exit(m.Run())
}

func qconfig() *quick.Config {
Expand Down

0 comments on commit 126f21b

Please sign in to comment.