Commit 644787c3 authored by Michael Munday's avatar Michael Munday

cmd/compile: delete temporary files when test finishes

I noticed some files prefixed with ssa_fg_tmp in the /tmp folder of
the s390x builder. runGenTest (a helper for TestGenFlowGraph) wasn't
deleting its temporary files. The distinct prefix made this easy to
figure out.

Change-Id: If0d608aaad04a414e74e29f027ec9443c626e4eb
Reviewed-on: https://go-review.googlesource.com/78475Reviewed-by: 's avatarDavid Chase <drchase@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
parent 4e19cfcd
......@@ -8,6 +8,7 @@ import (
"bytes"
"internal/testenv"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"runtime"
......@@ -64,6 +65,7 @@ func runGenTest(t *testing.T, filename, tmpname string, ev ...string) {
if ok != nil {
t.Fatalf("Failed to create temporary directory")
}
defer os.RemoveAll(tmpdir)
rungo := filepath.Join(tmpdir, "run.go")
ok = ioutil.WriteFile(rungo, stdout.Bytes(), 0600)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment