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

     1  [compiler:gccgo] skip
     2  
     3  # If coverpkg=m/sleepy... expands by package loading
     4  # (as opposed to pattern matching on deps)
     5  # then it will try to load sleepybad, which does not compile,
     6  # and the test command will fail.
     7  ! go list m/sleepy...
     8  go test -c -n -coverprofile=$TMPDIR/cover.out -coverpkg=m/sleepy... -run=^$ m/sleepy1
     9  
    10  -- go.mod --
    11  module m
    12  
    13  go 1.16
    14  -- sleepy1/p_test.go --
    15  package p
    16  
    17  import (
    18  	"testing"
    19  	"time"
    20  )
    21  
    22  func Test1(t *testing.T) {
    23  	time.Sleep(200 * time.Millisecond)
    24  }
    25  -- sleepy2/p_test.go --
    26  package p
    27  
    28  import (
    29  	"testing"
    30  	"time"
    31  )
    32  
    33  func Test1(t *testing.T) {
    34  	time.Sleep(200 * time.Millisecond)
    35  }
    36  -- sleepybad/p.go --
    37  package p
    38  
    39  import ^
    40  
    41  var _ = io.DoesNotExist
    42  

View as plain text