github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/testdata/script/test_main_twice.txt (about) 1 [short] skip 2 3 env GOCACHE=$WORK/tmp 4 go test -v multimain 5 stdout -count=2 notwithstanding # check tests ran twice 6 7 -- multimain/multimain_test.go -- 8 package multimain_test 9 10 import "testing" 11 12 func TestMain(m *testing.M) { 13 // Some users run m.Run multiple times, changing 14 // some kind of global state between runs. 15 // This used to work so I guess now it has to keep working. 16 // See golang.org/issue/23129. 17 m.Run() 18 m.Run() 19 } 20 21 func Test(t *testing.T) { 22 t.Log("notwithstanding") 23 }