mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
test: enable "-d=panic" by default for errorcheck*
Fixes #43311 Change-Id: I134d6c0524c198998a3c093dd3a8144052e8f7a9 Reviewed-on: https://go-review.googlesource.com/c/go/+/298715 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
c082f9fee0
commit
44721f4565
1 changed files with 3 additions and 2 deletions
|
|
@ -725,7 +725,7 @@ func (t *test) run() {
|
||||||
// Fail if wantError is true and compilation was successful and vice versa.
|
// Fail if wantError is true and compilation was successful and vice versa.
|
||||||
// Match errors produced by gc against errors in comments.
|
// Match errors produced by gc against errors in comments.
|
||||||
// TODO(gri) remove need for -C (disable printing of columns in error messages)
|
// TODO(gri) remove need for -C (disable printing of columns in error messages)
|
||||||
cmdline := []string{goTool(), "tool", "compile", "-C", "-e", "-o", "a.o"}
|
cmdline := []string{goTool(), "tool", "compile", "-d=panic", "-C", "-e", "-o", "a.o"}
|
||||||
// No need to add -dynlink even if linkshared if we're just checking for errors...
|
// No need to add -dynlink even if linkshared if we're just checking for errors...
|
||||||
cmdline = append(cmdline, flags...)
|
cmdline = append(cmdline, flags...)
|
||||||
cmdline = append(cmdline, long)
|
cmdline = append(cmdline, long)
|
||||||
|
|
@ -830,6 +830,7 @@ func (t *test) run() {
|
||||||
}
|
}
|
||||||
|
|
||||||
case "errorcheckdir", "errorcheckandrundir":
|
case "errorcheckdir", "errorcheckandrundir":
|
||||||
|
flags = append(flags, "-d=panic")
|
||||||
// Compile and errorCheck all files in the directory as packages in lexicographic order.
|
// Compile and errorCheck all files in the directory as packages in lexicographic order.
|
||||||
// If errorcheckdir and wantError, compilation of the last package must fail.
|
// If errorcheckdir and wantError, compilation of the last package must fail.
|
||||||
// If errorcheckandrundir and wantError, compilation of the package prior the last must fail.
|
// If errorcheckandrundir and wantError, compilation of the package prior the last must fail.
|
||||||
|
|
@ -1179,7 +1180,7 @@ func (t *test) run() {
|
||||||
t.err = fmt.Errorf("write tempfile:%s", err)
|
t.err = fmt.Errorf("write tempfile:%s", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cmdline := []string{goTool(), "tool", "compile", "-e", "-o", "a.o"}
|
cmdline := []string{goTool(), "tool", "compile", "-d=panic", "-e", "-o", "a.o"}
|
||||||
cmdline = append(cmdline, flags...)
|
cmdline = append(cmdline, flags...)
|
||||||
cmdline = append(cmdline, tfile)
|
cmdline = append(cmdline, tfile)
|
||||||
out, err = runcmd(cmdline...)
|
out, err = runcmd(cmdline...)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue