File tree Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- pkill -9 semu
3+ function cleanup {
4+ sleep 1
5+ pkill -9 semu
6+ }
47
5- expect << DONE
6- set timeout 120
8+ function ASSERT {
9+ $*
10+ local RES=$?
11+ if [ $RES -ne 0 ]; then
12+ echo ' Assert failed: "' $* ' "'
13+ exit $RES
14+ fi
15+ }
16+
17+ cleanup
18+
19+ ASSERT expect << DONE
20+ set timeout 90
721spawn make check
822expect "buildroot login:" { send "root\n" } timeout { exit 1 }
923expect "# " { send "uname -a\n" } timeout { exit 2 }
1024expect "riscv32 GNU/Linux" { send "\x01"; send "x" } timeout { exit 3 }
1125DONE
1226
1327ret=$?
14- pkill -9 semu
15- echo
28+ cleanup
1629
1730MESSAGES=(" OK!" \
1831 " Fail to boot" \
1932 " Fail to login" \
2033 " Fail to run commands" \
2134)
2235
23- echo " ${MESSAGES[$ret]} "
36+ COLOR_G=' \e[32;01m' # Green
37+ COLOR_N=' \e[0m'
38+ printf " \n[ ${COLOR_G}${MESSAGES[$ret]}${COLOR_N} ]\n"
39+
2440exit ${ret}
You can’t perform that action at this time.
0 commit comments