package spectest

import "github.com/tetratelabs/wazero/internal/integration_test/spectest"

Index

Functions

func Run

func Run(t *testing.T, testDataFS embed.FS, ctx context.Context, config wazero.RuntimeConfig)

Run runs all the test inside the testDataFS file system where all the cases are described via JSON files created from wast2json.

func RunCase

func RunCase(t *testing.T, testDataFS embed.FS, f string, ctx context.Context, config wazero.RuntimeConfig, mandatoryLine, lineBegin, lineEnd int)

RunCase runs the test case described by the given spectest file name (without .wast!) in the testDataFS file system. lineBegin and lineEnd are the line numbers to run. If lineBegin == 0 and lineEnd == math.MaxInt, all the lines are run.

For example, if you want to run memory_grow.wast:66 to 70, you can do:

RunCase(t, testDataFS, "memory_grow", ctx, config, mandatoryLine, 66, 70)

where mandatoryLine is the line number which can be run regardless of the lineBegin and lineEnd. It is useful when we only want to run specific command while running "module" command to instantiate a module. If you don't need it, just pass -1.

Source Files

spectest.go

Directories

PathSynopsis
internal/integration_test/spectest/threads
internal/integration_test/spectest/v1
internal/integration_test/spectest/v2
Version
v1.9.0 (latest)
Published
Feb 18, 2025
Platform
linux/amd64
Imports
14 packages
Last checked
4 days ago

Tools for package owners.