Registry / testing / solana-program-test

solana-program-test

JSON →
library4.0.0rscratesunverified

A framework for testing Solana programs in a simulated validator environment.

# Cargo.toml [dependencies] solana-program-test = "4.0.0"
INSTALL
IMPORT
SIG · SOLANA-PROGRAM-TES
S
solana-program-test
testingrustv4.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ProgramTest
use solana_program_test::ProgramTest;

Creates a new program test environment and starts it.

use solana_program_test::ProgramTest; let mut program_test = ProgramTest::new("my_program", program_id, processor!(process_instruction)); let (mut banks_client, payer, recent_blockhash) = program_test.start().await;
Debug
Known issues
gotchaRequires async runtime (tokio) to run tests.
fix
Add tokio as a dev-dependency and use #[tokio::test] for test functions.
affects: >=0.1.0
Upgrade
Version history
4.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
solana-program-test — cargo add solana-program-test · libregistry