aboutsummaryrefslogtreecommitdiff
path: root/scripts/ci.sh
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2020-11-20 02:49:06 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-11-20 02:49:06 +0000
commitb7a47bb06e4ea2037c26882c2282ee1f9aa34ba4 (patch)
tree62e1173064643de076d5710596b3cd6d390f4d00 /scripts/ci.sh
parent0522b74a7fee23b223e955de4496d6e529fb504d (diff)
parent5828870cd5f81de1cf45d959c3c9b53d550523d7 (diff)
downloadpin-project-b7a47bb06e4ea2037c26882c2282ee1f9aa34ba4.tar.gz
Upgrade rust/crates/pin-project to 1.0.2 am: 6c94c6bafe am: c686a2052d am: 0e059a5995 am: 5828870cd5
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pin-project/+/1504213 Change-Id: I0799f36b0c9e7763c76644e43a4bf010dc1525d3
Diffstat (limited to 'scripts/ci.sh')
-rwxr-xr-xscripts/ci.sh26
1 files changed, 13 insertions, 13 deletions
diff --git a/scripts/ci.sh b/scripts/ci.sh
index ec08568..b6a1a74 100755
--- a/scripts/ci.sh
+++ b/scripts/ci.sh
@@ -8,30 +8,30 @@
# Note: This script requires nightly Rust, rustfmt, clippy, and cargo-expand
set -euo pipefail
+IFS=$'\n\t'
-if [[ "${1:-none}" == "+"* ]]; then
- toolchain="${1}"
-else
- cargo +nightly -V >/dev/null || exit 1
- toolchain="+nightly"
+# Decide Rust toolchain. Nightly is used by default.
+toolchain="+nightly"
+if [[ "${1:-}" == "+"* ]]; then
+ toolchain="${1}"
+ shift
fi
+# Make sure toolchain is installed.
+cargo "${toolchain}" -V >/dev/null
if [[ "${toolchain:-+nightly}" != "+nightly"* ]] || ! rustfmt -V &>/dev/null || ! cargo clippy -V &>/dev/null || ! cargo expand -V &>/dev/null; then
- echo "error: ci.sh requires nightly Rust, rustfmt, clippy, and cargo-expand"
- exit 1
+ echo "error: ci.sh requires nightly Rust, rustfmt, clippy, and cargo-expand"
+ exit 1
fi
echo "Running 'cargo ${toolchain} fmt --all'"
cargo "${toolchain}" fmt --all
echo "Running 'cargo ${toolchain} clippy --all --all-targets'"
-cargo "${toolchain}" clippy --all --all-features --all-targets -Zunstable-options
+cargo "${toolchain}" clippy --all --all-features --all-targets -Z unstable-options
-echo "Running 'cargo ${toolchain} test --all --exclude expandtest'"
-TRYBUILD=overwrite cargo "${toolchain}" test --all --all-features --exclude expandtest
-
-echo "Running 'bash scripts/expandtest.sh ${toolchain}'"
-"$(cd "$(dirname "${0}")" && pwd)"/expandtest.sh "${toolchain}"
+echo "Running 'cargo ${toolchain} test --all'"
+cargo "${toolchain}" test --all --all-features
echo "Running 'cargo ${toolchain} doc --no-deps --all'"
cargo "${toolchain}" doc --no-deps --all --all-features