]>
Commit | Line | Data |
---|---|---|
04862afe ILT |
1 | # This test checks that multiple main packages can be tested |
2 | # with -coverpkg=all without duplicate symbol errors. | |
5a8ea165 | 3 | # Verifies golang.org/issue/30374, golang.org/issue/34114. |
04862afe ILT |
4 | |
5 | [short] skip | |
5a8ea165 ILT |
6 | cd $GOPATH/src/example.com/cov |
7 | ||
8 | env GO111MODULE=on | |
9 | go test -coverpkg=all ./... | |
04862afe | 10 | |
5a8ea165 | 11 | env GO111MODULE=off |
04862afe ILT |
12 | go test -coverpkg=all ./... |
13 | ||
5a8ea165 | 14 | -- $GOPATH/src/example.com/cov/go.mod -- |
04862afe ILT |
15 | module example.com/cov |
16 | ||
5a8ea165 | 17 | -- $GOPATH/src/example.com/cov/mainonly/mainonly.go -- |
04862afe ILT |
18 | package main |
19 | ||
20 | func main() {} | |
21 | ||
5a8ea165 | 22 | -- $GOPATH/src/example.com/cov/mainwithtest/mainwithtest.go -- |
04862afe ILT |
23 | package main |
24 | ||
25 | func main() {} | |
26 | ||
27 | func Foo() {} | |
28 | ||
5a8ea165 | 29 | -- $GOPATH/src/example.com/cov/mainwithtest/mainwithtest_test.go -- |
04862afe ILT |
30 | package main |
31 | ||
32 | import "testing" | |
33 | ||
34 | func TestFoo(t *testing.T) { | |
35 | Foo() | |
36 | } | |
37 | ||
5a8ea165 | 38 | -- $GOPATH/src/example.com/cov/xtest/x.go -- |
04862afe ILT |
39 | package x |
40 | ||
5a8ea165 | 41 | -- $GOPATH/src/example.com/cov/xtest/x_test.go -- |
04862afe ILT |
42 | package x_test |
43 | ||
44 | import "testing" | |
45 | ||
46 | func TestX(t *testing.T) {} |