#!/usr/bin/env bash

here=$(dirname "$0")

maybe_sbf_sdk="--sbf-sdk $here/sdk/sbf"
for a in "$@"; do
  if [[ $a = --sbf-sdk ]]; then
    maybe_sbf_sdk=
  fi
done

export CARGO_BUILD_SBF="$here"/cargo-build-sbf
set -x
exec "$here"/cargo run --manifest-path "$here"/sdk/cargo-test-sbf/Cargo.toml -- $maybe_sbf_sdk "$@"
