testing

package
v0.0.0-...-3940e3f Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SpecTest exec.ModuleDefinition = exec.NewHostModuleDefinition(func() (*specTest, error) {
	return &specTest{
		Global_i32: exec.NewGlobalI32(true, 666),
		Global_i64: exec.NewGlobalI64(true, 666),
		Global_f32: exec.NewGlobalF32(true, 0),
		Global_f64: exec.NewGlobalF64(true, 0),
		Table:      exec.NewTable(10, 20),
		Memory:     exec.NewMemory(1, 2),
	}, nil
})

Functions

func Pos

func Pos(line, column int) *wast.Pos

func RunScript

func RunScript(t *testing.T, loader Loader, path string, strict bool, ignore []string)

Types

type Action

type Action interface {
	Pos() wast.Pos
	Run(e *Environment) ([]interface{}, error)
}

func Get

func Get(pos *wast.Pos, module, export string) Action

func InstantiateModule

func InstantiateModule(pos *wast.Pos, name string, def exec.ModuleDefinition) Action

func Invoke

func Invoke(pos *wast.Pos, module, export string, args ...interface{}) Action

type Environment

type Environment struct {
	// contains filtered or unexported fields
}

func NewEnvironment

func NewEnvironment(loader Loader) (*Environment, error)

func (*Environment) AssertExhaustion

func (e *Environment) AssertExhaustion(t *testing.T, pos *wast.Pos, action Action, failure string, strict bool)

func (*Environment) AssertReturn

func (e *Environment) AssertReturn(t *testing.T, pos *wast.Pos, action Action, strict bool, expected ...interface{})

func (*Environment) AssertTrap

func (e *Environment) AssertTrap(t *testing.T, pos *wast.Pos, action Action, failure string)

func (*Environment) AssertUnlinkable

func (e *Environment) AssertUnlinkable(t *testing.T, pos *wast.Pos, definition exec.ModuleDefinition, failure string, strict bool)

func (*Environment) InstantiateModule

func (e *Environment) InstantiateModule(t *testing.T, pos *wast.Pos, name string, definition exec.ModuleDefinition)

func (*Environment) Register

func (e *Environment) Register(export, module string)

func (*Environment) RunCommand

func (e *Environment) RunCommand(t *testing.T, command wast.Command, strict bool)

func (*Environment) RunScript

func (e *Environment) RunScript(t *testing.T, script *wast.Script, strict bool, ignore []string)

type Loader

type Loader func(m *wasm.Module) (exec.ModuleDefinition, error)

Jump to

Keyboard shortcuts

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