diff options
author | Ian Lance Taylor <iant@golang.org> | 2020-08-26 17:26:05 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2020-08-27 23:19:15 +0000 |
commit | 4f76fe86756841befb6574ce4bf04113d14389d4 (patch) | |
tree | 7c99448c043961b189d1c05a7b63d4b411b8acf3 /src/cmd/go/internal/test/test.go | |
parent | cdc635547fc436dc49c91ddb172b0e101febd3d7 (diff) | |
download | go-4f76fe86756841befb6574ce4bf04113d14389d4.tar.gz go-4f76fe86756841befb6574ce4bf04113d14389d4.zip |
cmd/go, testing, os: fail test that calls os.Exit(0)
This catches cases where a test calls code that calls os.Exit(0),
thereby skipping all subsequent tests.
Fixes #29062
Change-Id: If9478972f40189e27623557e7141469ca4234d89
Reviewed-on: https://go-review.googlesource.com/c/go/+/250977
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/test/test.go')
-rw-r--r-- | src/cmd/go/internal/test/test.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmd/go/internal/test/test.go b/src/cmd/go/internal/test/test.go index 3aee6939d2..1ea6d2881e 100644 --- a/src/cmd/go/internal/test/test.go +++ b/src/cmd/go/internal/test/test.go @@ -1164,7 +1164,8 @@ func (c *runCache) builderRunTest(b *work.Builder, ctx context.Context, a *work. if !c.disableCache && len(execCmd) == 0 { testlogArg = []string{"-test.testlogfile=" + a.Objdir + "testlog.txt"} } - args := str.StringList(execCmd, a.Deps[0].BuiltTarget(), testlogArg, testArgs) + panicArg := "-test.paniconexit0" + args := str.StringList(execCmd, a.Deps[0].BuiltTarget(), testlogArg, panicArg, testArgs) if testCoverProfile != "" { // Write coverage to temporary profile, for merging later. |