aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/ci/script.sh
diff options
context:
space:
mode:
Diffstat (limited to 'cortex-m-rt/ci/script.sh')
-rwxr-xr-x[-rw-r--r--]cortex-m-rt/ci/script.sh44
1 files changed, 23 insertions, 21 deletions
diff --git a/cortex-m-rt/ci/script.sh b/cortex-m-rt/ci/script.sh
index cccf5c9..6b4c759 100644..100755
--- a/cortex-m-rt/ci/script.sh
+++ b/cortex-m-rt/ci/script.sh
@@ -1,11 +1,13 @@
+#!/usr/bin/env bash
+
set -euxo pipefail
main() {
- cargo check --target $TARGET
+ cargo check --target "$TARGET"
- cargo check --target $TARGET --features device
+ cargo check --target "$TARGET" --features device
- if [ $TARGET = x86_64-unknown-linux-gnu ] && [ $TRAVIS_RUST_VERSION = stable ]; then
+ if [ "$TARGET" = x86_64-unknown-linux-gnu ] && [ "$TRAVIS_RUST_VERSION" = stable ]; then
( cd macros && cargo check && cargo test )
cargo test --features device --test compiletest
@@ -31,56 +33,56 @@ main() {
local fail_examples=(
data_overflow
)
- if [ $TARGET != x86_64-unknown-linux-gnu ]; then
+ if [ "$TARGET" != x86_64-unknown-linux-gnu ]; then
# linking with GNU LD
for ex in "${examples[@]}"; do
- cargo rustc --target $TARGET --example $ex -- \
+ cargo rustc --target "$TARGET" --example "$ex" -- \
-C linker=arm-none-eabi-ld
- cargo rustc --target $TARGET --example $ex --release -- \
+ cargo rustc --target "$TARGET" --example "$ex" --release -- \
-C linker=arm-none-eabi-ld
done
for ex in "${fail_examples[@]}"; do
- ! cargo rustc --target $TARGET --example $ex -- \
+ ! cargo rustc --target "$TARGET" --example "$ex" -- \
-C linker=arm-none-eabi-ld
- ! cargo rustc --target $TARGET --example $ex --release -- \
+ ! cargo rustc --target "$TARGET" --example "$ex" --release -- \
-C linker=arm-none-eabi-ld
done
- cargo rustc --target $TARGET --example device --features device -- \
+ cargo rustc --target "$TARGET" --example device --features device -- \
-C linker=arm-none-eabi-ld
- cargo rustc --target $TARGET --example device --features device --release -- \
+ cargo rustc --target "$TARGET" --example device --features device --release -- \
-C linker=arm-none-eabi-ld
# linking with rustc's LLD
for ex in "${examples[@]}"; do
- cargo rustc --target $TARGET --example $ex
- cargo rustc --target $TARGET --example $ex --release
+ cargo rustc --target "$TARGET" --example "$ex"
+ cargo rustc --target "$TARGET" --example "$ex" --release
done
for ex in "${fail_examples[@]}"; do
- ! cargo rustc --target $TARGET --example $ex
- ! cargo rustc --target $TARGET --example $ex --release
+ ! cargo rustc --target "$TARGET" --example "$ex"
+ ! cargo rustc --target "$TARGET" --example "$ex" --release
done
- cargo rustc --target $TARGET --example device --features device
- cargo rustc --target $TARGET --example device --features device --release
+ cargo rustc --target "$TARGET" --example device --features device
+ cargo rustc --target "$TARGET" --example device --features device --release
fi
case $TARGET in
thumbv6m-none-eabi|thumbv7m-none-eabi)
# linking with GNU LD
- env RUSTFLAGS="-C linker=arm-none-eabi-ld -C link-arg=-Tlink.x" cargo run --target $TARGET --example qemu | grep "x = 42"
- env RUSTFLAGS="-C linker=arm-none-eabi-ld -C link-arg=-Tlink.x" cargo run --target $TARGET --example qemu --release | grep "x = 42"
+ env RUSTFLAGS="-C linker=arm-none-eabi-ld -C link-arg=-Tlink.x" cargo run --target "$TARGET" --example qemu | grep "x = 42"
+ env RUSTFLAGS="-C linker=arm-none-eabi-ld -C link-arg=-Tlink.x" cargo run --target "$TARGET" --example qemu --release | grep "x = 42"
# linking with rustc's LLD
- cargo run --target $TARGET --example qemu | grep "x = 42"
- cargo run --target $TARGET --example qemu --release | grep "x = 42"
+ cargo run --target "$TARGET" --example qemu | grep "x = 42"
+ cargo run --target "$TARGET" --example qemu --release | grep "x = 42"
;;
esac
- if [ $TARGET = x86_64-unknown-linux-gnu ]; then
+ if [ "$TARGET" = x86_64-unknown-linux-gnu ]; then
./check-blobs.sh
fi
}