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 ¶
- Variables
- func Descriptor() plugin.Descriptor
- func FramesDescriptor() plugin.Descriptor
- func FramesGuest() (*plugin.Guest, error)
- func Guest() (*plugin.Guest, error)
- func Run(t *testing.T, factory Factory)
- func RunFrames(t *testing.T, factory Factory, opts FramesOptions)
- func RunFramesWithHost(t *testing.T, factory Factory, openHost OpenFramesHost, opts FramesOptions)
- func RunWithHost(t *testing.T, factory Factory, openHost OpenHost)
- type Factory
- type FramesHost
- type FramesOptions
- type Host
- type OpenFramesHost
- type OpenHost
Constants ¶
This section is empty.
Variables ¶
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 ¶
FramesGuest is the reference guest of the frames suite.
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)
Types ¶
type FramesHost ¶
type FramesHost interface {
Call(context.Context, plugin.ContractRef, string, json.RawMessage) (json.RawMessage, error)
CallProgress(context.Context, plugin.ContractRef, string, json.RawMessage, func(plugin.Progress), ...plugin.CallOptions) (json.RawMessage, error)
State() plugin.State
Abort() error
}
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.
type OpenFramesHost ¶
type OpenFramesHost func(context.Context, plugin.Descriptor, plugin.Options) (FramesHost, error)
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. |