From 644787c337f7fde20a0676f843bb12378c8f885e Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Fri, 17 Nov 2017 10:01:06 +0000 Subject: [PATCH] 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/78475 Reviewed-by: David Chase Run-TryBot: Brad Fitzpatrick --- src/cmd/compile/internal/gc/ssa_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cmd/compile/internal/gc/ssa_test.go b/src/cmd/compile/internal/gc/ssa_test.go index 03d6f4218f..28670542e7 100644 --- a/src/cmd/compile/internal/gc/ssa_test.go +++ b/src/cmd/compile/internal/gc/ssa_test.go @@ -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) -- 2.48.1