Skip to content

vox-plugin-test-harness API Reference (generated)

Crate: vox-plugin-test-harness · Version: 0.6.0 · Target: Library (lib.rs)

Shared test utilities for Vox plugin authors: manifest fixture builders and temp plugin directory helpers.

Shared test utilities for Vox plugin authors:

  • [manifest_builder] — fluent builders for Plugin.toml TOML strings
  • [plugin_dir] — [PluginDir] temp-directory helper
use vox_plugin_test_harness::manifest_builder::CodeManifestBuilder;
use vox_plugin_test_harness::plugin_dir::{PluginDir, assert_manifest_parses};
let toml = CodeManifestBuilder::new("test-plugin")
.extension_point("MlBackend")
// vox-arch-check: allow dynlib-ext
.artifact("linux-x86_64", "libtest.so")
.build();
let dir = PluginDir::from_toml(&toml).expect("valid toml");
let manifest = dir.parse_manifest().expect("round-trip");
assert_eq!(manifest.plugin.id, "test-plugin");
DependencyKind
vox-plugin-typesNormal
ModuleDescription
manifest_builder—
plugin_dir—
Dependency Topology, diagram 12 nodes, 1 edge: vox-plugin-test-harness → vox-plugin-typesvox-plugin-test-harnessvox-plugin-types
Diagram source
graph {
direction: right
node vox_plugin_test_harness: "vox-plugin-test-harness"
node vox_plugin_types: "vox-plugin-types"
vox_plugin_test_harness -> vox_plugin_types
}
KindSymbolSignatureSourceDescription
structmanifest_builder::CodeManifestBuilderpub struct CodeManifestBuildercrates/vox-plugin-test-harness/src/manifest_builder.rs#L4-L16Builds a minimal Code-kind Plugin.toml TOML string.
fnmanifest_builder::newpub fn new(id: impl Into<String>) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L19-L34—
fnmanifest_builder::namepub fn name(mut self, name: impl Into<String>) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L36-L39—
fnmanifest_builder::versionpub fn version(mut self, v: impl Into<String>) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L40-L43—
fnmanifest_builder::descriptionpub fn description(mut self, d: impl Into<String>) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L44-L47—
fnmanifest_builder::min_vox_versionpub fn min_vox_version(mut self, v: impl Into<String>) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L48-L51—
fnmanifest_builder::abi_versionpub fn abi_version(mut self, v: u32) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L52-L55—
fnmanifest_builder::extension_pointpub fn extension_point(mut self, ep: impl Into<String>) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L56-L59—
fnmanifest_builder::artifactpub fn artifact(mut self, target: impl Into<String>, file: impl Into<String>) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L60-L63—
fnmanifest_builder::statuspub fn status(mut self, s: impl Into<String>) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L64-L67—
fnmanifest_builder::categorypub fn category(mut self, c: impl Into<String>) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L68-L71—
fnmanifest_builder::tagpub fn tag(mut self, t: impl Into<String>) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L72-L75—
fnmanifest_builder::buildpub fn build(self) -> Stringcrates/vox-plugin-test-harness/src/manifest_builder.rs#L78-L120Render to a Plugin.toml TOML string.
structmanifest_builder::SkillManifestBuilderpub struct SkillManifestBuildercrates/vox-plugin-test-harness/src/manifest_builder.rs#L124-L133Builds a minimal Skill-kind Plugin.toml TOML string.
fnmanifest_builder::newpub fn new(id: impl Into<String>) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L136-L148—
fnmanifest_builder::namepub fn name(mut self, n: impl Into<String>) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L150-L153—
fnmanifest_builder::versionpub fn version(mut self, v: impl Into<String>) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L154-L157—
fnmanifest_builder::descriptionpub fn description(mut self, d: impl Into<String>) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L158-L161—
fnmanifest_builder::skill_mdpub fn skill_md(mut self, path: impl Into<String>) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L162-L165—
fnmanifest_builder::exposespub fn exposes(mut self, tool: impl Into<String>) -> Selfcrates/vox-plugin-test-harness/src/manifest_builder.rs#L166-L169—
fnmanifest_builder::buildpub fn build(self) -> Stringcrates/vox-plugin-test-harness/src/manifest_builder.rs#L171-L196—
structplugin_dir::PluginDirpub struct PluginDircrates/vox-plugin-test-harness/src/plugin_dir.rs#L12-L15A temporary plugin root directory containing a valid Plugin.toml. Cleaned up automatically when the value is dropped. Use [PluginDir::path] to pass the directory to vox-plugin-host loader APIs.
fnplugin_dir::from_tomlpub fn from_toml(toml_src: &str) -> Result<Self, Box<dyn std::error::Error>>crates/vox-plugin-test-harness/src/plugin_dir.rs#L22-L30Create a PluginDir from a Plugin.toml TOML source string. Parses the TOML eagerly so tests fail immediately on invalid manifests rather than only at loader call time.
fnplugin_dir::pathpub fn path(&self) -> &Pathcrates/vox-plugin-test-harness/src/plugin_dir.rs#L33-L35Path to the temporary plugin root directory.
fnplugin_dir::manifest_pathpub fn manifest_path(&self) -> PathBufcrates/vox-plugin-test-harness/src/plugin_dir.rs#L38-L40Path to the Plugin.toml file inside the directory.
fnplugin_dir::parse_manifestpub fn parse_manifest(&self) -> Result<PluginManifest, Box<dyn std::error::Error>>crates/vox-plugin-test-harness/src/plugin_dir.rs#L43-L46Read back and parse the manifest. Useful for round-trip assertions.
fnplugin_dir::touchpub fn touch(&self, relative_path: impl AsRef<Path>) -> Result<(), std::io::Error>crates/vox-plugin-test-harness/src/plugin_dir.rs#L52-L59Write an empty file at relative_path inside the plugin dir. Use this to pre-create artifact stubs (e.g. libfoo.so) so that loaders that check file existence before loading don’t fail early.
fnplugin_dir::assert_manifest_parsespub fn assert_manifest_parses(toml_src: &str) -> PluginManifestcrates/vox-plugin-test-harness/src/plugin_dir.rs#L66-L69Assert that a Plugin.toml TOML string parses without error. Panics with a readable error message on failure.