Run BPF program unit tests (#18982)

This commit is contained in:
Jack May
2021-07-30 15:15:06 -07:00
committed by GitHub
parent 049fb0417f
commit 0247c280ff
2 changed files with 8 additions and 8 deletions

View File

@ -41,26 +41,26 @@ test-stable-bpf)
# solana-keygen required when building C programs
_ "$cargo" build --manifest-path=keygen/Cargo.toml
export PATH="$PWD/target/debug":$PATH
cargo_build_bpf="$(realpath ./cargo-build-bpf)"
cargo_test_bpf="$(realpath ./cargo-test-bpf)"
# BPF solana-sdk legacy compile test
"$cargo_build_bpf" --manifest-path sdk/Cargo.toml
# BPF Program unit 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
# BPF C program system tests
_ make -C programs/bpf/c tests
_ "$cargo" stable test \
--manifest-path programs/bpf/Cargo.toml \
--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
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
fi
done

View File

@ -662,7 +662,7 @@ mod test {
fn create_program_address_is_defined() {
assert_eq!(
Pubkey::create_program_address(&[b"You pass butter"], &Pubkey::default()).unwrap_err(),
PubkeyError::InvalidSeeds
PubkeyError::IllegalOwner
);
}
}