cargo-test-bpf 569 B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. here=$(dirname "$0")
  3. maybe_bpf_sdk="--bpf-sdk $here/sdk/bpf"
  4. for a in "$@"; do
  5. if [[ $a = --bpf-sdk ]]; then
  6. maybe_bpf_sdk=
  7. fi
  8. done
  9. export CARGO_BUILD_BPF="$here"/cargo-build-bpf
  10. set -x
  11. if [[ ! -f "$here"/target/debug/cargo-build-sbf ]]; then
  12. cargo build --manifest-path "$here"/sdk/cargo-build-sbf/Cargo.toml
  13. fi
  14. if [[ ! -f "$here"/target/debug/cargo-test-sbf ]]; then
  15. cargo build --manifest-path "$here"/sdk/cargo-test-sbf/Cargo.toml
  16. fi
  17. exec cargo run --manifest-path "$here"/sdk/cargo-test-bpf/Cargo.toml -- $maybe_bpf_sdk "$@"