...
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...
8go test -c -n -coverprofile=$TMPDIR/cover.out -coverpkg=m/sleepy... -run=^$ m/sleepy1
9
10-- go.mod --
11module m
12
13go 1.16
14-- sleepy1/p_test.go --
15package p
16
17import (
18 "testing"
19 "time"
20)
21
22func Test1(t *testing.T) {
23 time.Sleep(200 * time.Millisecond)
24}
25-- sleepy2/p_test.go --
26package p
27
28import (
29 "testing"
30 "time"
31)
32
33func Test1(t *testing.T) {
34 time.Sleep(200 * time.Millisecond)
35}
36-- sleepybad/p.go --
37package p
38
39import ^
40
41var _ = io.DoesNotExist
View as plain text