Make sure failed tests report their exit code (#240)

Commit 72c1660c13cb8cf0d590d91fb03625a68e53900f 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.
This commit is contained in:
Michael Hendricks 2021-04-23 18:38:02 -06:00 committed by GitHub
parent 8e7d6335c9
commit 126f21b002
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {