set -eo pipefail
if [ -f Cargo.toml ]; then
dir=$(dirname "${BASH_SOURCE[0]}")
"$dir/pre-commit"
cargo test -r --doc
if command -v rustup > /dev/null; then
rustup target add thumbv7m-none-eabi
(cd tests/ensure_no_std; cargo build -r --target thumbv7m-none-eabi)
fi
cargo build -r --example regorus --no-default-features --features std
cargo build -r --all-features
cargo test -r
cargo test -r --test aci
cargo test -r --test kata
cargo test -r --features rego-extensions
cargo test -r --test aci rego-extensions
cargo test -r --test kata rego-extensions
cargo test -r --features opa-testutil,serde_json/arbitrary_precision,rego-extensions --test opa -- $(tr '\n' ' ' < tests/opa.passing)
fi