mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-30 17:29:04 +00:00
all: change references of 'wasi' to 'wasip1'; test hygiene
This commit is contained in:
@@ -33,7 +33,7 @@ func TestClangAttributes(t *testing.T) {
|
|||||||
"k210",
|
"k210",
|
||||||
"nintendoswitch",
|
"nintendoswitch",
|
||||||
"riscv-qemu",
|
"riscv-qemu",
|
||||||
"wasi",
|
"wasip1",
|
||||||
"wasm",
|
"wasm",
|
||||||
"wasm-unknown",
|
"wasm-unknown",
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -51,6 +51,7 @@ func TestCorpus(t *testing.T) {
|
|||||||
if *testTarget != "" {
|
if *testTarget != "" {
|
||||||
target = *testTarget
|
target = *testTarget
|
||||||
}
|
}
|
||||||
|
isWASI := strings.HasPrefix(target, "wasi")
|
||||||
|
|
||||||
repos, err := loadRepos(*corpus)
|
repos, err := loadRepos(*corpus)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -69,7 +70,7 @@ func TestCorpus(t *testing.T) {
|
|||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
if target == "wasi" && repo.SkipWASI {
|
if isWASI && repo.SkipWASI {
|
||||||
t.Skip("skip wasi")
|
t.Skip("skip wasi")
|
||||||
}
|
}
|
||||||
if repo.Slow && testing.Short() {
|
if repo.Slow && testing.Short() {
|
||||||
@@ -135,7 +136,7 @@ func TestCorpus(t *testing.T) {
|
|||||||
t.Run(dir.Pkg, func(t *testing.T) {
|
t.Run(dir.Pkg, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
if target == "wasi" && dir.SkipWASI {
|
if isWASI && dir.SkipWASI {
|
||||||
t.Skip("skip wasi")
|
t.Skip("skip wasi")
|
||||||
}
|
}
|
||||||
if dir.Slow && testing.Short() {
|
if dir.Slow && testing.Short() {
|
||||||
|
|||||||
+8
-5
@@ -179,7 +179,7 @@ func TestBuild(t *testing.T) {
|
|||||||
})
|
})
|
||||||
t.Run("WASI", func(t *testing.T) {
|
t.Run("WASI", func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
runPlatTests(optionsFromTarget("wasi", sema), tests, t)
|
runPlatTests(optionsFromTarget("wasip1", sema), tests, t)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -192,7 +192,10 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) {
|
|||||||
t.Fatal("failed to load target spec:", err)
|
t.Fatal("failed to load target spec:", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
isWebAssembly := options.Target == "wasi" || options.Target == "wasm" || (options.Target == "" && options.GOARCH == "wasm")
|
// FIXME: this should really be:
|
||||||
|
// isWebAssembly := strings.HasPrefix(spec.Triple, "wasm")
|
||||||
|
isWASI := strings.HasPrefix(options.Target, "wasi")
|
||||||
|
isWebAssembly := isWASI || strings.HasPrefix(options.Target, "wasm") || (options.Target == "" && strings.HasPrefix(options.GOARCH, "wasm"))
|
||||||
|
|
||||||
for _, name := range tests {
|
for _, name := range tests {
|
||||||
if options.GOOS == "linux" && (options.GOARCH == "arm" || options.GOARCH == "386") {
|
if options.GOOS == "linux" && (options.GOARCH == "arm" || options.GOARCH == "386") {
|
||||||
@@ -252,13 +255,13 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) {
|
|||||||
runTest("alias.go", options, t, nil, nil)
|
runTest("alias.go", options, t, nil, nil)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if options.Target == "" || options.Target == "wasi" {
|
if options.Target == "" || isWASI {
|
||||||
t.Run("filesystem.go", func(t *testing.T) {
|
t.Run("filesystem.go", func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
runTest("filesystem.go", options, t, nil, nil)
|
runTest("filesystem.go", options, t, nil, nil)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if options.Target == "" || options.Target == "wasi" || options.Target == "wasm" {
|
if options.Target == "" || options.Target == "wasm" || isWASI {
|
||||||
t.Run("rand.go", func(t *testing.T) {
|
t.Run("rand.go", func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
runTest("rand.go", options, t, nil, nil)
|
runTest("rand.go", options, t, nil, nil)
|
||||||
@@ -492,7 +495,7 @@ func TestTest(t *testing.T) {
|
|||||||
|
|
||||||
// Node/Wasmtime
|
// Node/Wasmtime
|
||||||
targ{"WASM", optionsFromTarget("wasm", sema)},
|
targ{"WASM", optionsFromTarget("wasm", sema)},
|
||||||
targ{"WASI", optionsFromTarget("wasi", sema)},
|
targ{"WASI", optionsFromTarget("wasip1", sema)},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
for _, targ := range targs {
|
for _, targ := range targs {
|
||||||
|
|||||||
Reference in New Issue
Block a user