mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-14 16:03:41 +00:00
os, testing: just check runtime.GOOS == "wasip1"
This commit is contained in:
@@ -1,5 +0,0 @@
|
|||||||
//go:build !wasip1
|
|
||||||
|
|
||||||
package os_test
|
|
||||||
|
|
||||||
const isWASI = false
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
//go:build wasip1
|
|
||||||
|
|
||||||
package os_test
|
|
||||||
|
|
||||||
const isWASI = true
|
|
||||||
@@ -275,7 +275,7 @@ func TestDirFS(t *testing.T) {
|
|||||||
t.Log("TODO: implement Readdir for Windows")
|
t.Log("TODO: implement Readdir for Windows")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if isWASI {
|
if runtime.GOOS == "wasip1" {
|
||||||
t.Log("TODO: allow foo/bar/. as synonym for path foo/bar on wasi?")
|
t.Log("TODO: allow foo/bar/. as synonym for path foo/bar on wasi?")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -296,7 +296,7 @@ func TestDirFSPathsValid(t *testing.T) {
|
|||||||
t.Log("skipping on Windows")
|
t.Log("skipping on Windows")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if isWASI {
|
if runtime.GOOS == "wasip1" {
|
||||||
t.Log("skipping on wasi because it fails on wasi on windows")
|
t.Log("skipping on wasi because it fails on wasi on windows")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
// Copyright 2016 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
//
|
|
||||||
//go:build !wasip1
|
|
||||||
|
|
||||||
package testing_test
|
|
||||||
|
|
||||||
const isWASI = false
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
// Copyright 2016 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
//
|
|
||||||
//go:build wasip1
|
|
||||||
|
|
||||||
package testing_test
|
|
||||||
|
|
||||||
const isWASI = true
|
|
||||||
@@ -13,6 +13,7 @@ import (
|
|||||||
"io/fs"
|
"io/fs"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -25,7 +26,7 @@ func TestMain(m *testing.M) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestTempDirInCleanup(t *testing.T) {
|
func TestTempDirInCleanup(t *testing.T) {
|
||||||
if isWASI {
|
if runtime.GOOS == "wasip1" {
|
||||||
t.Log("Skipping. TODO: implement RemoveAll for wasi")
|
t.Log("Skipping. TODO: implement RemoveAll for wasi")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -62,7 +63,7 @@ func TestTempDirInBenchmark(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestTempDir(t *testing.T) {
|
func TestTempDir(t *testing.T) {
|
||||||
if isWASI {
|
if runtime.GOOS == "wasip1" {
|
||||||
t.Log("Skipping. TODO: implement RemoveAll for wasi")
|
t.Log("Skipping. TODO: implement RemoveAll for wasi")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user