mirror of
https://github.com/golang/go.git
synced 2026-02-07 02:09:55 +00:00
cmd/cover, cmd/covdata: actually delete temp dirs
The code was using defer in TestMain, but was also calling os.Exit, which meant that the deferred functions did not run. TestMain does not require calling os.Exit, so stop doing it. Change-Id: I25ca64c36acf65dae3dc3f46e5fa513b9460a8e9 Reviewed-on: https://go-review.googlesource.com/c/go/+/740781 Reviewed-by: Than McIntosh <thanm@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
1c9abbdc8e
commit
07f7f8ca52
2 changed files with 2 additions and 2 deletions
|
|
@ -50,7 +50,7 @@ func TestMain(m *testing.M) {
|
|||
fmt.Fprintf(os.Stderr, "debug: preserving tmpdir %s\n", topTmpdir)
|
||||
}
|
||||
os.Setenv("CMDCOVDATA_TEST_RUN_MAIN", "true")
|
||||
os.Exit(m.Run())
|
||||
m.Run()
|
||||
}
|
||||
|
||||
var tdmu sync.Mutex
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ func TestMain(m *testing.M) {
|
|||
fmt.Fprintf(os.Stderr, "debug: preserving tmpdir %s\n", topTmpdir)
|
||||
}
|
||||
os.Setenv("CMDCOVER_TEST_RUN_MAIN", "normal")
|
||||
os.Exit(m.Run())
|
||||
m.Run()
|
||||
}
|
||||
|
||||
var tdmu sync.Mutex
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue