Run BPF program unit tests (#18982)
This commit is contained in:
@ -41,26 +41,26 @@ test-stable-bpf)
|
|||||||
|
|
||||||
# solana-keygen required when building C programs
|
# solana-keygen required when building C programs
|
||||||
_ "$cargo" build --manifest-path=keygen/Cargo.toml
|
_ "$cargo" build --manifest-path=keygen/Cargo.toml
|
||||||
|
|
||||||
export PATH="$PWD/target/debug":$PATH
|
export PATH="$PWD/target/debug":$PATH
|
||||||
cargo_build_bpf="$(realpath ./cargo-build-bpf)"
|
cargo_build_bpf="$(realpath ./cargo-build-bpf)"
|
||||||
|
cargo_test_bpf="$(realpath ./cargo-test-bpf)"
|
||||||
|
|
||||||
# BPF solana-sdk legacy compile test
|
# BPF solana-sdk legacy compile test
|
||||||
"$cargo_build_bpf" --manifest-path sdk/Cargo.toml
|
"$cargo_build_bpf" --manifest-path sdk/Cargo.toml
|
||||||
|
|
||||||
# BPF Program unit tests
|
# BPF C program system tests
|
||||||
"$cargo" test --manifest-path programs/bpf/Cargo.toml
|
|
||||||
"$cargo_build_bpf" --manifest-path programs/bpf/Cargo.toml --bpf-sdk sdk/bpf
|
|
||||||
|
|
||||||
# BPF program system tests
|
|
||||||
_ make -C programs/bpf/c tests
|
_ make -C programs/bpf/c tests
|
||||||
_ "$cargo" stable test \
|
_ "$cargo" stable test \
|
||||||
--manifest-path programs/bpf/Cargo.toml \
|
--manifest-path programs/bpf/Cargo.toml \
|
||||||
--no-default-features --features=bpf_c,bpf_rust -- --nocapture
|
--no-default-features --features=bpf_c,bpf_rust -- --nocapture
|
||||||
|
|
||||||
# Dump BPF program assembly listings
|
# BPF Rust program unit tests
|
||||||
for bpf_test in programs/bpf/rust/*; do
|
for bpf_test in programs/bpf/rust/*; do
|
||||||
if pushd "$bpf_test"; then
|
if pushd "$bpf_test"; then
|
||||||
"$cargo_build_bpf" --dump
|
"$cargo" test
|
||||||
|
"$cargo_build_bpf" --bpf-sdk ../../../../sdk/bpf --dump
|
||||||
|
"$cargo_test_bpf" --bpf-sdk ../../../../sdk/bpf
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -662,7 +662,7 @@ mod test {
|
|||||||
fn create_program_address_is_defined() {
|
fn create_program_address_is_defined() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Pubkey::create_program_address(&[b"You pass butter"], &Pubkey::default()).unwrap_err(),
|
Pubkey::create_program_address(&[b"You pass butter"], &Pubkey::default()).unwrap_err(),
|
||||||
PubkeyError::InvalidSeeds
|
PubkeyError::IllegalOwner
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user