@@ -179,7 +179,7 @@ func TestBuild(t *testing.T) {
179
179
})
180
180
t .Run ("WASI" , func (t * testing.T ) {
181
181
t .Parallel ()
182
- runPlatTests (optionsFromTarget ("wasi " , sema ), tests , t )
182
+ runPlatTests (optionsFromTarget ("wasip1 " , sema ), tests , t )
183
183
})
184
184
}
185
185
}
@@ -192,7 +192,10 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) {
192
192
t .Fatal ("failed to load target spec:" , err )
193
193
}
194
194
195
- isWebAssembly := options .Target == "wasi" || options .Target == "wasm" || (options .Target == "" && options .GOARCH == "wasm" )
195
+ // FIXME: this should really be:
196
+ // isWebAssembly := strings.HasPrefix(spec.Triple, "wasm")
197
+ isWASI := strings .HasPrefix (options .Target , "wasi" )
198
+ isWebAssembly := isWASI || strings .HasPrefix (options .Target , "wasm" ) || (options .Target == "" && strings .HasPrefix (options .GOARCH , "wasm" ))
196
199
197
200
for _ , name := range tests {
198
201
if options .GOOS == "linux" && (options .GOARCH == "arm" || options .GOARCH == "386" ) {
@@ -252,13 +255,13 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) {
252
255
runTest ("alias.go" , options , t , nil , nil )
253
256
})
254
257
}
255
- if options .Target == "" || options . Target == "wasi" {
258
+ if options .Target == "" || isWASI {
256
259
t .Run ("filesystem.go" , func (t * testing.T ) {
257
260
t .Parallel ()
258
261
runTest ("filesystem.go" , options , t , nil , nil )
259
262
})
260
263
}
261
- if options .Target == "" || options .Target == "wasi " || options . Target == "wasm" {
264
+ if options .Target == "" || options .Target == "wasm " || isWASI {
262
265
t .Run ("rand.go" , func (t * testing.T ) {
263
266
t .Parallel ()
264
267
runTest ("rand.go" , options , t , nil , nil )
@@ -492,7 +495,7 @@ func TestTest(t *testing.T) {
492
495
493
496
// Node/Wasmtime
494
497
targ {"WASM" , optionsFromTarget ("wasm" , sema )},
495
- targ {"WASI" , optionsFromTarget ("wasi " , sema )},
498
+ targ {"WASI" , optionsFromTarget ("wasip1 " , sema )},
496
499
)
497
500
}
498
501
for _ , targ := range targs {
0 commit comments