1
+ #! /usr/bin/env bash
2
+
1
3
set -euxo pipefail
2
4
3
5
main () {
4
- cargo check --target $TARGET
6
+ cargo check --target " $TARGET "
5
7
6
- cargo check --target $TARGET --features device
8
+ cargo check --target " $TARGET " --features device
7
9
8
- if [ $TARGET = x86_64-unknown-linux-gnu ] && [ $TRAVIS_RUST_VERSION = stable ]; then
10
+ if [ " $TARGET " = x86_64-unknown-linux-gnu ] && [ " $TRAVIS_RUST_VERSION " = stable ]; then
9
11
( cd macros && cargo check && cargo test )
10
12
11
13
cargo test --features device --test compiletest
@@ -31,56 +33,56 @@ main() {
31
33
local fail_examples=(
32
34
data_overflow
33
35
)
34
- if [ $TARGET != x86_64-unknown-linux-gnu ]; then
36
+ if [ " $TARGET " != x86_64-unknown-linux-gnu ]; then
35
37
# linking with GNU LD
36
38
for ex in " ${examples[@]} " ; do
37
- cargo rustc --target $TARGET --example $ex -- \
39
+ cargo rustc --target " $TARGET " --example " $ex " -- \
38
40
-C linker=arm-none-eabi-ld
39
41
40
- cargo rustc --target $TARGET --example $ex --release -- \
42
+ cargo rustc --target " $TARGET " --example " $ex " --release -- \
41
43
-C linker=arm-none-eabi-ld
42
44
done
43
45
for ex in " ${fail_examples[@]} " ; do
44
- ! cargo rustc --target $TARGET --example $ex -- \
46
+ ! cargo rustc --target " $TARGET " --example " $ex " -- \
45
47
-C linker=arm-none-eabi-ld
46
48
47
- ! cargo rustc --target $TARGET --example $ex --release -- \
49
+ ! cargo rustc --target " $TARGET " --example " $ex " --release -- \
48
50
-C linker=arm-none-eabi-ld
49
51
done
50
52
51
- cargo rustc --target $TARGET --example device --features device -- \
53
+ cargo rustc --target " $TARGET " --example device --features device -- \
52
54
-C linker=arm-none-eabi-ld
53
55
54
- cargo rustc --target $TARGET --example device --features device --release -- \
56
+ cargo rustc --target " $TARGET " --example device --features device --release -- \
55
57
-C linker=arm-none-eabi-ld
56
58
57
59
# linking with rustc's LLD
58
60
for ex in " ${examples[@]} " ; do
59
- cargo rustc --target $TARGET --example $ex
60
- cargo rustc --target $TARGET --example $ex --release
61
+ cargo rustc --target " $TARGET " --example " $ex "
62
+ cargo rustc --target " $TARGET " --example " $ex " --release
61
63
done
62
64
for ex in " ${fail_examples[@]} " ; do
63
- ! cargo rustc --target $TARGET --example $ex
64
- ! cargo rustc --target $TARGET --example $ex --release
65
+ ! cargo rustc --target " $TARGET " --example " $ex "
66
+ ! cargo rustc --target " $TARGET " --example " $ex " --release
65
67
done
66
68
67
- cargo rustc --target $TARGET --example device --features device
68
- cargo rustc --target $TARGET --example device --features device --release
69
+ cargo rustc --target " $TARGET " --example device --features device
70
+ cargo rustc --target " $TARGET " --example device --features device --release
69
71
fi
70
72
71
73
case $TARGET in
72
74
thumbv6m-none-eabi|thumbv7m-none-eabi)
73
75
# linking with GNU LD
74
- env RUSTFLAGS=" -C linker=arm-none-eabi-ld -C link-arg=-Tlink.x" cargo run --target $TARGET --example qemu | grep " x = 42"
75
- env RUSTFLAGS=" -C linker=arm-none-eabi-ld -C link-arg=-Tlink.x" cargo run --target $TARGET --example qemu --release | grep " x = 42"
76
+ env RUSTFLAGS=" -C linker=arm-none-eabi-ld -C link-arg=-Tlink.x" cargo run --target " $TARGET " --example qemu | grep " x = 42"
77
+ env RUSTFLAGS=" -C linker=arm-none-eabi-ld -C link-arg=-Tlink.x" cargo run --target " $TARGET " --example qemu --release | grep " x = 42"
76
78
77
79
# linking with rustc's LLD
78
- cargo run --target $TARGET --example qemu | grep " x = 42"
79
- cargo run --target $TARGET --example qemu --release | grep " x = 42"
80
+ cargo run --target " $TARGET " --example qemu | grep " x = 42"
81
+ cargo run --target " $TARGET " --example qemu --release | grep " x = 42"
80
82
;;
81
83
esac
82
84
83
- if [ $TARGET = x86_64-unknown-linux-gnu ]; then
85
+ if [ " $TARGET " = x86_64-unknown-linux-gnu ]; then
84
86
./check-blobs.sh
85
87
fi
86
88
}
0 commit comments