aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/test_main_twice.txt
blob: f32d4fc3b528c8a8a8f3ac1bf2ca1ab849898c52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[short] skip

env GOCACHE=$WORK/tmp
go test -v multimain
stdout -count=2 notwithstanding # check tests ran twice

-- go.mod --
module multimain

go 1.16
-- multimain_test.go --
package multimain_test

import "testing"

func TestMain(m *testing.M) {
	// Some users run m.Run multiple times, changing
	// some kind of global state between runs.
	// This used to work so I guess now it has to keep working.
	// See golang.org/issue/23129.
	m.Run()
	m.Run()
}

func Test(t *testing.T) {
	t.Log("notwithstanding")
}