-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathrun_examples.sh
executable file
·52 lines (44 loc) · 1.66 KB
/
run_examples.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
#!/bin/bash
set -euxo pipefail
MEMBERS=$(taplo get -f examples/Cargo.toml 'workspace.members')
# TODO(bing): add debug
PROFILES=("release")
failed=""
skipped=""
for profile in "${PROFILES[@]}"; do
for member in ${MEMBERS}; do
BINS=$(taplo get -f examples/"${member}"/Cargo.toml 'bin.*.name')
for bin in ${BINS}; do
echo "(mozak-cli) running example (${profile}): ${bin}"
case ${bin} in
# TODO(bing): fix to work with this script
"panic")
echo "(mozak-cli) skipping (${profile}): ${bin}"
skipped="${skipped}${bin} (${profile})\n"
continue
;;
# For this, we skip without writing to skipped because we
# run the native version along with the mozakvm version.
"token-native" | "tokenbin" | "wallet-native" | "walletbin" | "inputtape-native" | "inputtapebin")
echo "(mozak-cli) skipping (${profile}): ${bin}"
continue
;;
esac
# shellcheck disable=SC2086
# Double quoting the iotapes here is not what we want since we
# want an empty argument if iotapes are not required.
if ! cargo run --bin mozak-cli \
run -vvv examples/target/riscv32im-mozak-mozakvm-elf/"${profile}"/"${bin}"; then
failed="${failed}${bin} (${profile})\n"
fi
done
done
done
if [ -n "$skipped" ]; then
echo -e "\nSome tests were skipped:\n${skipped}"
fi
if [ -n "$failed" ]; then
echo -e "\nSome tests failed:\n${failed}"
exit 1
fi
exit 0