Expand description
Testing helpers for Fidius plugin authors and hosts.
This crate provides the infrastructure the Fidius codebase uses internally
for its own tests, now exposed so downstream users don’t have to reinvent
the wheel. Add it under [dev-dependencies] and you get:
dylib_fixture— build a plugin crate’s cdylib viacargo build, cached across tests in the same process. Optional signing viaDylibFixtureBuilder::signed_with.signing::fixture_keypair— deterministic Ed25519 keypair for tests.signing::sign_dylib— produce a.sigfile next to a dylib.
§Example
ⓘ
use fidius_test::dylib_fixture;
use fidius_host::PluginHost;
#[test]
fn loads_plugin() {
let fixture = dylib_fixture("./path/to/my-plugin").build();
let host = PluginHost::builder()
.search_path(fixture.dir())
.build()
.unwrap();
let plugins = host.discover().unwrap();
assert!(!plugins.is_empty());
}Re-exports§
pub use dylib::dylib_fixture;pub use dylib::DylibFixture;pub use dylib::DylibFixtureBuilder;pub use signing::fixture_keypair;pub use signing::fixture_keypair_with_seed;pub use signing::sign_dylib;