-
Notifications
You must be signed in to change notification settings - Fork 4
/
test_rustbook.sh
executable file
·39 lines (31 loc) · 1020 Bytes
/
test_rustbook.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -e
{ set +x; } 2>/dev/null
echo ""
echo -e "\e[1m========================================"
echo -e "\e[1mTEST: Rustbook examples"
echo -e "\e[1m========================================\e[0m"
if [ ! -d "tests/rustbook" ] ; then
git clone https://github.com/rust-embedded/cortex-m-quickstart tests/rustbook
else
cd "tests/rustbook"
git pull https://github.com/rust-embedded/cortex-m-quickstart
cd ..
cd ..
fi
sed -i 's/{{authors}}/jjkt/g' tests/rustbook/Cargo.toml
sed -i 's/{{project-name}}/zmu-tests/g' tests/rustbook/Cargo.toml
cd tests/rustbook
declare -a arr=("panic" "test_on_host" "hello" "exception" "itm" "crash")
for i in "${arr[@]}"
do
echo "cargo build --example $i"
cargo build --example $i
done
cd ../..
for i in "${arr[@]}"
do
echo "./target/release/zmu-armv7m run tests/rustbook/target/thumbv7m-none-eabi/debug/examples/$i"
timeout 1s ./target/release/zmu-armv7m run tests/rustbook/target/thumbv7m-none-eabi/debug/examples/$i || true
echo ""
done