Allows to set the version of CLI (#1176)

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
This commit is contained in:
Takeshi Yoneda
2023-02-28 01:09:41 -08:00
committed by GitHub
parent 599e01b65a
commit 9c07b2793d
6 changed files with 18 additions and 42 deletions

View File

@@ -14,7 +14,6 @@ import (
"github.com/tetratelabs/wazero/internal/leb128"
"github.com/tetratelabs/wazero/internal/platform"
"github.com/tetratelabs/wazero/internal/testing/require"
"github.com/tetratelabs/wazero/internal/version"
"github.com/tetratelabs/wazero/internal/wasm"
binaryformat "github.com/tetratelabs/wazero/internal/wasm/binary"
"github.com/tetratelabs/wazero/sys"
@@ -41,19 +40,6 @@ func (h *HostContext) Err() error { return nil }
func (h *HostContext) Value(key interface{}) interface{} { return nil }
func TestNewRuntimeWithConfig_version(t *testing.T) {
cfg := NewRuntimeConfig().(*runtimeConfig)
oldNewEngine := cfg.newEngine
cfg.newEngine = func(ctx context.Context, features api.CoreFeatures, _ filecache.Cache) wasm.Engine {
// Ensures that wazeroVersion is propagated to the engine.
v := ctx.Value(version.WazeroVersionKey{})
require.NotNil(t, v)
require.Equal(t, wazeroVersion, v.(string))
return oldNewEngine(ctx, features, nil)
}
_ = NewRuntimeWithConfig(testCtx, cfg)
}
func TestRuntime_CompileModule(t *testing.T) {
tests := []struct {
name string