1 [short] skip
2 [compiler:gccgo] skip
3
4 # Test line numbers in cover errors.
5
6 # Get errors from a go test into stderr.txt
7 ! go test coverbad
8 stderr 'p\.go:4:2' # look for error at coverbad/p.go:4
9 [cgo] stderr 'p1\.go:6:2' # look for error at coverbad/p.go:6
10 ! stderr $WORK # make sure temporary directory isn't in error
11
12 cp stderr $WORK/stderr.txt
13
14 # Get errors from coverage into stderr2.txt
15 ! go test -cover coverbad
16 cp stderr $WORK/stderr2.txt
17
18 wait # for go run above
19
20 cmp $WORK/stderr.txt $WORK/stderr2.txt
21
22 -- go.mod --
23 module coverbad
24
25 go 1.16
26 -- p.go --
27 package p
28
29 func f() {
30 g()
31 }
32 -- p1.go --
33 package p
34
35 import "C"
36
37 func h() {
38 j()
39 }
40 -- p_test.go --
41 package p
42
43 import "testing"
44
45 func Test(t *testing.T) {}
46
View as plain text