Skip to content

Commit 44721f4

Browse files
committed
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 <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]>
1 parent c082f9f commit 44721f4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/run.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ func (t *test) run() {
725725
// Fail if wantError is true and compilation was successful and vice versa.
726726
// Match errors produced by gc against errors in comments.
727727
// TODO(gri) remove need for -C (disable printing of columns in error messages)
728-
cmdline := []string{goTool(), "tool", "compile", "-C", "-e", "-o", "a.o"}
728+
cmdline := []string{goTool(), "tool", "compile", "-d=panic", "-C", "-e", "-o", "a.o"}
729729
// No need to add -dynlink even if linkshared if we're just checking for errors...
730730
cmdline = append(cmdline, flags...)
731731
cmdline = append(cmdline, long)
@@ -830,6 +830,7 @@ func (t *test) run() {
830830
}
831831

832832
case "errorcheckdir", "errorcheckandrundir":
833+
flags = append(flags, "-d=panic")
833834
// Compile and errorCheck all files in the directory as packages in lexicographic order.
834835
// If errorcheckdir and wantError, compilation of the last package must fail.
835836
// If errorcheckandrundir and wantError, compilation of the package prior the last must fail.
@@ -1179,7 +1180,7 @@ func (t *test) run() {
11791180
t.err = fmt.Errorf("write tempfile:%s", err)
11801181
return
11811182
}
1182-
cmdline := []string{goTool(), "tool", "compile", "-e", "-o", "a.o"}
1183+
cmdline := []string{goTool(), "tool", "compile", "-d=panic", "-e", "-o", "a.o"}
11831184
cmdline = append(cmdline, flags...)
11841185
cmdline = append(cmdline, tfile)
11851186
out, err = runcmd(cmdline...)

0 commit comments

Comments
 (0)