diff mbox series

libgo patch committed: Remove temporary directories in gccgoimporter test

Message ID CAOyqgcU0CevCZxQN5bQRocOpc8ehbft56cNp2rHFF+Q14RJ7Zw@mail.gmail.com
State New
Headers show
Series libgo patch committed: Remove temporary directories in gccgoimporter test | expand

Commit Message

Ian Lance Taylor March 2, 2019, 12:50 a.m. UTC
This libgo patches fixes the go/internal/gccgoimporter test to remove
temporary directories.  This is for PR 89406.  Bootstrapped and ran Go
testsuite on x86_64-pc-linux-gnu.  Committed to mainline.

Ian
diff mbox series

Patch

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 269333)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@ 
-a72eca1f435002076655fd6a54ce869ac39856dc
+decbbfb563ecf4609a3148dc789ae77ab1c62768
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/go/go/internal/gccgoimporter/importer_test.go
===================================================================
--- libgo/go/go/internal/gccgoimporter/importer_test.go	(revision 269196)
+++ libgo/go/go/internal/gccgoimporter/importer_test.go	(working copy)
@@ -143,17 +143,21 @@  func TestObjImporter(t *testing.T) {
 	}
 	t.Logf("gccgo version %d.%d", major, minor)
 
-	tmpdir, err := ioutil.TempDir("", "")
+	tmpdir, err := ioutil.TempDir("", "TestObjImporter")
 	if err != nil {
 		t.Fatal(err)
 	}
+	defer os.RemoveAll(tmpdir)
+
 	initmap := make(map[*types.Package]InitData)
 	imp := GetImporter([]string{tmpdir}, initmap)
 
-	artmpdir, err := ioutil.TempDir("", "")
+	artmpdir, err := ioutil.TempDir("", "TestObjImporter")
 	if err != nil {
 		t.Fatal(err)
 	}
+	defer os.RemoveAll(artmpdir)
+
 	arinitmap := make(map[*types.Package]InitData)
 	arimp := GetImporter([]string{artmpdir}, arinitmap)
 
@@ -198,8 +202,4 @@  func TestObjImporter(t *testing.T) {
 			t.Fatal(err)
 		}
 	}
-
-	if err = os.Remove(tmpdir); err != nil {
-		t.Fatal(err)
-	}
 }