enginetest

package
v0.0.0-...-29e2939 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package enginetest contains tests common to any wasm.Engine implementation. Defining these as top-level functions is less burden than copy/pasting the implementations, while still allowing test caching to operate.

Ex. In simplest case, dispatch:

func TestModuleEngine_Call(t *testing.T) {
	enginetest.RunTestModuleEngine_Call(t, NewEngine)
}

Ex. Some tests using the JIT Engine may need to guard as they use compiled features:

func TestModuleEngine_Call(t *testing.T) {
	requireSupportedOSArch(t)
	enginetest.RunTestModuleEngine_Call(t, NewEngine)
}

Note: These tests intentionally avoid using wasm.Store as it is important to know both the dependencies and the capabilities at the wasm.Engine abstraction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunTestEngine_NewModuleEngine

func RunTestEngine_NewModuleEngine(t *testing.T, et EngineTester)

func RunTestEngine_NewModuleEngine_InitTable

func RunTestEngine_NewModuleEngine_InitTable(t *testing.T, et EngineTester)

func RunTestModuleEngine_Call

func RunTestModuleEngine_Call(t *testing.T, et EngineTester)

func RunTestModuleEngine_Call_Errors

func RunTestModuleEngine_Call_Errors(t *testing.T, et EngineTester)

func RunTestModuleEngine_Call_HostFn

func RunTestModuleEngine_Call_HostFn(t *testing.T, et EngineTester)

Types

type EngineTester

type EngineTester interface {
	NewEngine() wasm.Engine
	InitTable(me wasm.ModuleEngine, initTableLen uint32, initTableIdxToFnIdx map[wasm.Index]wasm.Index) []interface{}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL