Documentation
¶
Overview ¶
Package fakeplugin lets a Go test binary act as a native Atmos plugin without shell commands or platform-specific executables. Call MaybeServe first in TestMain, then launch the test binary (os.Executable) as the plugin with its working directory set to a directory that WriteMode prepared.
Index ¶
Constants ¶
View Source
const ( // ModeEcho writes "ok" and exits successfully. ModeEcho = "echo" // ModeHang records its pid and never returns, ignoring cancellation. ModeHang = "hang" // ModeSpawn is ModeHang plus a descendant process whose pid is recorded as well. ModeSpawn = "spawn" )
Modes select what the fake plugin's command does.
Variables ¶
This section is empty.
Functions ¶
func MaybeServe ¶
MaybeServe runs the process as a fake plugin (or a long-sleeping helper) when launched as one and reports whether it did. Optional registration functions add fixture services. A true result means TestMain must return without running tests.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.