plugintest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package plugintest supplies a reusable conformance suite for CTX backends. Factories bind Guest() locally or in a dedicated subprocess and must return a fresh owned backend each time. The suite performs real transport calls.

Index

Constants

This section is empty.

Variables

View Source
var (
	FramesContract = plugin.ContractRef{Name: "ext.frames", Version: "v1"}
	FramesHostRef  = plugin.ContractRef{Name: "host.svc", Version: "v1"}
)

Functions

func Descriptor

func Descriptor() plugin.Descriptor

func FramesDescriptor

func FramesDescriptor() plugin.Descriptor

func FramesGuest

func FramesGuest() (*plugin.Guest, error)

FramesGuest is the reference guest of the frames suite.

func Guest

func Guest() (*plugin.Guest, error)

func Run

func Run(t *testing.T, factory Factory)

func RunFrames

func RunFrames(t *testing.T, factory Factory, opts FramesOptions)

RunFrames runs the frames suite against guests the pure-Go session hosts.

func RunFramesWithHost

func RunFramesWithHost(t *testing.T, factory Factory, openHost OpenFramesHost, opts FramesOptions)

func RunWithHost

func RunWithHost(t *testing.T, factory Factory, openHost OpenHost)

Types

type Factory

type Factory func(context.Context) (plugin.Backend, error)

type FramesHost

FramesHost is the session surface the frames suite uses.

type FramesOptions

type FramesOptions struct {
	// Concurrent is true for a guest that can wait for the host's answer to a
	// request and still serve what arrives, so it can have several requests
	// outstanding at once and call its host between forward calls (a thread, or an
	// event loop). A guest without it, such as a WebAssembly command or a
	// single-threaded one, answers those operations with the public error
	// "unsupported".
	Concurrent bool
}

FramesOptions says what the guest under test can do.

type Host

type Host interface {
	Call(context.Context, plugin.ContractRef, string, json.RawMessage) (json.RawMessage, error)
	State() plugin.State
	Close(context.Context) error
	Abort() error
}

Host is the common session surface exercised by backend conformance. A language binding may run the same suite without wrapping a Go Session.

Directories

Path Synopsis
Package enginetest holds the differential checks that hold an engine of the shared C implementation against the pure-Go engine, which is the oracle: the same documents, requests, schemas and endpoints are judged by both, and the answers must agree.
Package enginetest holds the differential checks that hold an engine of the shared C implementation against the pure-Go engine, which is the oracle: the same documents, requests, schemas and endpoints are judged by both, and the answers must agree.

Jump to

Keyboard shortcuts

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