wasitest

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestSystem

func TestSystem(t *testing.T, makeSystem MakeSystem)

TestSystem is a test suite which validates the behavior of wasi.System implementations.

func TestWASIP1

func TestWASIP1(t *testing.T, filePaths []string, makeSystem MakeSystem)

TestWASIP1 is a generic test suite which runs the list of WebAssembly programs passed as file paths, creating a system and runtime to execute each of the test programs.

Tests pass if the execution completed without trapping nor calling proc_exit with a non-zero exit code.

Types

type MakeSystem

type MakeSystem func(TestConfig) (wasi.System, error)

MakeSystem is a function used to create a system to run the test suites against.

The test guarantees that the system will be closed when it isn't needed anymore.

type TestConfig

type TestConfig struct {
	Args    []string
	Environ []string
	Stdin   io.ReadCloser
	Stdout  io.WriteCloser
	Stderr  io.WriteCloser
	Rand    io.Reader
	RootFS  string
	Now     func() time.Time
	// Limits, zero means none.
	MaxOpenFiles int
	MaxOpenDirs  int
}

TestConfig carries the configuration used to create systems to run the test suites against.

Jump to

Keyboard shortcuts

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