mirror of
https://github.com/openharmony/third_party_rust_bindgen.git
synced 2026-07-25 23:45:28 -04:00
62 lines
1.7 KiB
Bash
Executable File
62 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -xeu
|
|
cd "$(dirname "$0")/.."
|
|
|
|
# Note that `$BINDGEN_PROFILE` is never in quotes so that it expands to nothing
|
|
# (not even an empty string argument) when the variable is empty. This is
|
|
# necessary so we don't pass an unexpected flag to cargo.
|
|
|
|
export RUST_BACKTRACE=1
|
|
|
|
case "$BINDGEN_JOB" in
|
|
"test")
|
|
# Need rustfmt to compare the test expectations.
|
|
rustup update nightly
|
|
rustup component add rustfmt
|
|
rustup component add --toolchain nightly rustfmt
|
|
RUSTFMT="$(rustup which rustfmt)"
|
|
export RUSTFMT
|
|
cargo test "$BINDGEN_PROFILE" --features "$BINDGEN_FEATURES"
|
|
./ci/assert-no-diff.sh
|
|
;;
|
|
|
|
"integration")
|
|
cd ./bindgen-integration
|
|
cargo test "$BINDGEN_PROFILE" --features "$BINDGEN_FEATURES"
|
|
;;
|
|
|
|
"nofeatures")
|
|
rustup update nightly
|
|
rustup component add rustfmt
|
|
rustup component add --toolchain nightly rustfmt
|
|
RUSTFMT="$(rustup which rustfmt)"
|
|
export RUSTFMT
|
|
cargo test "$BINDGEN_PROFILE" --no-default-features
|
|
./ci/assert-no-diff.sh
|
|
;;
|
|
|
|
"expectations")
|
|
cd ./tests/expectations
|
|
cargo test "$BINDGEN_PROFILE"
|
|
;;
|
|
|
|
"misc")
|
|
./ci/assert-docs.sh
|
|
./ci/test-book.sh
|
|
./ci/no-includes.sh
|
|
# Disabled because https://github.com/rust-lang/rustfmt/issues/3799.
|
|
# ./ci/assert-rustfmt.sh
|
|
;;
|
|
|
|
"quickchecking")
|
|
cd ./tests/quickchecking
|
|
# TODO: Actually run quickchecks once `bindgen` is reliable enough.
|
|
cargo test
|
|
;;
|
|
|
|
*)
|
|
echo "Error! Unknown \$BINDGEN_JOB: '$BINDGEN_JOB'"
|
|
exit 1
|
|
esac
|