...

Text file src/cmd/go/testdata/script/cover_pkgall_multiple_mains.txt

Documentation: cmd/go/testdata/script

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

View as plain text