plugintest

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package plugintest loads a plugin the way an app does, for the plugin author's own tests. New hands back a loaded plugin and closes it when the test ends; the test brings the host, a fake one or a real one, in Options.Host.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(t *testing.T, dir string, opts plugin.Options) *plugin.Plugin

New loads the plugin in dir for a test, filling in what a test usually doesn't care about and leaving the rest of opts as given:

  • an empty DataDir becomes t.TempDir(), so no test sees another's storage;
  • a zero CallTimeout becomes ten seconds;
  • a nil Host.Logf becomes t.Logf, so a plugin's console output shows in the test's output.

The plugin is closed when the test ends. One that doesn't load fails the test.

Types

This section is empty.

Jump to

Keyboard shortcuts

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