diff options
author | 2019-11-21 23:52:55 +0100 | |
---|---|---|
committer | 2019-11-21 23:52:55 +0100 | |
commit | 528b1bdbea22d7f4214b0aa545893cfb155b77c3 (patch) | |
tree | 5b661846fe638eeff5dbe37abba3772e069316b6 /cortex-m-rt/ci/script.sh | |
parent | 2f11f0b439a610f4716375d0b0c5005f7e63cf40 (diff) | |
download | cortex-m-528b1bdbea22d7f4214b0aa545893cfb155b77c3.tar.gz cortex-m-528b1bdbea22d7f4214b0aa545893cfb155b77c3.tar.zst cortex-m-528b1bdbea22d7f4214b0aa545893cfb155b77c3.zip |
CI: Add shebangs and address shellcheck warnings
Diffstat (limited to 'cortex-m-rt/ci/script.sh')
-rwxr-xr-x[-rw-r--r--] | cortex-m-rt/ci/script.sh | 44 |
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 } |