Skip to main content

Crate ic_testkit

Crate ic_testkit 

Source
Expand description

Focused PocketIC test-harness utilities for Internet Computer canisters.

Import native PocketIC clients and DTOs from ic_testkit::pocket_ic. pic adds optional typed Wire calls, extension traits for installation, diagnostics and snapshots, startup errors, caller-owned managed-server startup and bounded readiness polling. It does not provide a simulator wrapper or a host-wide runtime lock.

The crate also provides:

  • marker parsing, aggregation, comparison, and reports in benchmark;
  • canister-side marker emission in performance (Wasm only);
  • deterministic test principals through fake_principal.

The pic helpers are unavailable when compiling for wasm32; parsing and analysis are native-only. Benchmark data types, checked marker formatting and marker emission remain available to canister code.

Modules§

benchmark
Compact benchmark markers on every target; parsing and analysis on native hosts.
pic
PocketIC host-test harness extensions.
pocket_ic
Maintained PocketIC 16.1 client implementation; see ../upstream/NOTICE.md. The client is async-only and uses the caller’s Tokio runtime. Build with an explicit server URL and await operations. Explicitly await PocketIc::drop before releasing a borrowed server; Rust Drop performs no I/O.

Functions§

fake_principal
Deterministically derive a test Principal from seed.