aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt
diff options
context:
space:
mode:
authorGravatar bors[bot] <26634292+bors[bot]@users.noreply.github.com> 2019-11-22 00:04:27 +0000
committerGravatar GitHub <noreply@github.com> 2019-11-22 00:04:27 +0000
commit0457438264923a8c19016c25ae757b2dc9ee6d01 (patch)
tree5b661846fe638eeff5dbe37abba3772e069316b6 /cortex-m-rt
parent2f11f0b439a610f4716375d0b0c5005f7e63cf40 (diff)
parent528b1bdbea22d7f4214b0aa545893cfb155b77c3 (diff)
downloadcortex-m-0457438264923a8c19016c25ae757b2dc9ee6d01.tar.gz
cortex-m-0457438264923a8c19016c25ae757b2dc9ee6d01.tar.zst
cortex-m-0457438264923a8c19016c25ae757b2dc9ee6d01.zip
Merge #218
218: CI: Add shebangs and address shellcheck warnings r=adamgreig a=jonas-schievink Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Diffstat (limited to 'cortex-m-rt')
-rwxr-xr-x[-rw-r--r--]cortex-m-rt/ci/install.sh6
-rwxr-xr-x[-rw-r--r--]cortex-m-rt/ci/script.sh44
2 files changed, 27 insertions, 23 deletions
diff --git a/cortex-m-rt/ci/install.sh b/cortex-m-rt/ci/install.sh
index aa9f149..2086800 100644..100755
--- a/cortex-m-rt/ci/install.sh
+++ b/cortex-m-rt/ci/install.sh
@@ -1,8 +1,10 @@
+#!/usr/bin/env bash
+
set -euxo pipefail
main() {
- if [ $TARGET != x86_64-unknown-linux-gnu ]; then
- rustup target add $TARGET
+ if [ "$TARGET" != x86_64-unknown-linux-gnu ]; then
+ rustup target add "$TARGET"
fi
mkdir gcc
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
}