When running tests under wasmtime, provide a fresh TMPDIR.

Also fix a couple os tests that wrote to current directory to write to os.TempDir() instead.

After this, os tests pass in wasi, so add them to the list run by "make tinygo-test-wasi".
This commit is contained in:
Dan Kegel
2022-01-01 13:30:53 -08:00
committed by Ron Evans
parent e046b23773
commit ec97313239
3 changed files with 11 additions and 3 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ func randomName() string {
}
func TestMkdir(t *testing.T) {
dir := "TestMkdir" + randomName()
dir := TempDir() + "/TestMkdir" + randomName()
Remove(dir)
err := Mkdir(dir, 0755)
defer Remove(dir)
@@ -65,7 +65,7 @@ func writeFile(t *testing.T, fname string, flag int, text string) string {
}
func TestRemove(t *testing.T) {
f := "TestRemove" + randomName()
f := TempDir() + "/TestRemove" + randomName()
err := Remove(f)
if err == nil {