wazevo: adds test harness for v2 spectests (#1683)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
package spectest
|
||||
package v2
|
||||
|
||||
import (
|
||||
"context"
|
||||
"embed"
|
||||
"testing"
|
||||
|
||||
"github.com/tetratelabs/wazero"
|
||||
@@ -11,19 +10,15 @@ import (
|
||||
"github.com/tetratelabs/wazero/internal/platform"
|
||||
)
|
||||
|
||||
//go:embed testdata/*.wasm
|
||||
//go:embed testdata/*.json
|
||||
var testcases embed.FS
|
||||
|
||||
const enabledFeatures = api.CoreFeaturesV2
|
||||
|
||||
func TestCompiler(t *testing.T) {
|
||||
if !platform.CompilerSupported() {
|
||||
t.Skip()
|
||||
}
|
||||
spectest.Run(t, testcases, context.Background(), wazero.NewRuntimeConfigCompiler().WithCoreFeatures(enabledFeatures))
|
||||
spectest.Run(t, Testcases, context.Background(), wazero.NewRuntimeConfigCompiler().WithCoreFeatures(enabledFeatures))
|
||||
}
|
||||
|
||||
func TestInterpreter(t *testing.T) {
|
||||
spectest.Run(t, testcases, context.Background(), wazero.NewRuntimeConfigInterpreter().WithCoreFeatures(enabledFeatures))
|
||||
spectest.Run(t, Testcases, context.Background(), wazero.NewRuntimeConfigInterpreter().WithCoreFeatures(enabledFeatures))
|
||||
}
|
||||
|
||||
9
internal/integration_test/spectest/v2/spectest.go
Normal file
9
internal/integration_test/spectest/v2/spectest.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package v2
|
||||
|
||||
import "embed"
|
||||
|
||||
// Testcases is exported for testing wazevo in internal/engine/wazevo.
|
||||
//
|
||||
//go:embed testdata/*.wasm
|
||||
//go:embed testdata/*.json
|
||||
var Testcases embed.FS
|
||||
Reference in New Issue
Block a user