-
Notifications
You must be signed in to change notification settings - Fork 6
/
test.sh
executable file
·122 lines (101 loc) · 3.62 KB
/
test.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/usr/bin/env bash
set -e
dir=$(pwd)
echo "====================== download toolchains =================================="
toolchains_dir="${dir}/toolchains"
mkdir -p $toolchains_dir
armv7_toolchain="gcc-linaro-7.4.1-2019.02-i686_arm-linux-gnueabihf"
armv7_toolchain_url="https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/arm-linux-gnueabihf/${armv7_toolchain}.tar.xz"
armv7_toolchain_dir="${toolchains_dir}/${armv7_toolchain}"
if [ ! -d "${armv7_toolchain_dir}" ]; then
(
cd $toolchains_dir
curl -LO $armv7_toolchain_url
tar xf "${armv7_toolchain}.tar.xz"
)
else
echo "Using existing armv7 toolchain at ${armv7_toolchain_dir}"
fi
armv8_toolchain="gcc-linaro-7.4.1-2019.02-i686_aarch64-linux-gnu"
armv8_toolchain_url="https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/aarch64-linux-gnu/${armv8_toolchain}.tar.xz"
armv8_toolchain_dir="${toolchains_dir}/${armv8_toolchain}"
if [ ! -d "${armv8_toolchain_dir}" ]; then
(
cd $toolchains_dir
curl -LO $armv8_toolchain_url
tar xf "${armv8_toolchain}.tar.xz"
)
else
echo "Using existing aarch64 toolchain at ${armv8_toolchain_dir}"
fi
x86_64_toolchain="x86_64-linux-gnu-7"
x86_64_toolchain_dir="${toolchains_dir}/${x86_64_toolchain}"
if [ ! -d "${x86_64_toolchain_dir}" ]; then
(
cd $toolchains_dir
if [ ! -f /usr/bin/x86_64-linux-gnu-gcc-7 ]; then
echo "gcc-7 is missing, run sudo apt install -y gcc-7"
exit 1
fi
mkdir -p ${x86_64_toolchain}/bin
(
cd ${x86_64_toolchain}/bin
ln -s /usr/bin/x86_64-linux-gnu-gcc-7 x86_64-linux-gnu-gcc
ln -s /usr/bin/x86_64-linux-gnu-gcc-ar-7 x86_64-linux-gnu-gcc-ar
ln -s /usr/bin/x86_64-linux-gnu-gcc-nm-7 x86_64-linux-gnu-gcc-nm
)
)
else
echo "Using existing x86_64 toolchain at ${x86_64_toolchain_dir}"
fi
echo "====================== run tests =================================="
RUSTFLAGS="-C link-args=-no-pie" cargo +stable build
RUSTFLAGS="-C link-args=-no-pie" cargo +stable test
RUSTFLAGS="-C link-args=-no-pie" cargo +nightly test
(
cd selfe-config
cargo +stable test
cargo +nightly test
cargo build --bin selfe --features bin
cargo test --features bin
)
(
cd selfe-arc
./test.sh
)
(
cd example_application
(
export PATH="${armv7_toolchain_dir}/bin:${PATH}"
echo "++++++++++++ Sabre"
SEL4_PLATFORM=sabre cargo xbuild --target armv7-unknown-linux-gnueabihf
echo "++++++++++++ TX1"
SEL4_PLATFORM=tx1 cargo xbuild --target aarch64-unknown-linux-gnu
)
(
export PATH="${armv8_toolchain_dir}/bin:${PATH}"
echo "++++++++++++ virt"
SEL4_PLATFORM=virt cargo xbuild --target aarch64-unknown-linux-gnu
)
(
export PATH="${x86_64_toolchain_dir}/bin:${PATH}"
echo "++++++++++++ pc99"
SEL4_PLATFORM=pc99 cargo xbuild --target=x86_64-unknown-linux-gnu
)
(
export PATH="${armv7_toolchain_dir}/bin:${PATH}"
echo "++++++++++++ Sabre E2E"
../selfe-config/target/debug/selfe build --sel4_arch aarch32 --platform sabre
)
(
export PATH="${armv8_toolchain_dir}/bin:${PATH}"
echo "++++++++++++ Virt E2E"
../selfe-config/target/debug/selfe build --sel4_arch aarch64 --platform virt
)
(
export PATH="${x86_64_toolchain_dir}/bin:${PATH}"
echo "++++++++++++ pc99"
../selfe-config/target/debug/selfe build --sel4_arch x86_64 --platform pc99 --debug
../selfe-config/target/debug/selfe build --sel4_arch x86_64 --platform pc99 --release
)
)