Update expect.sh

This commit is contained in:
Lup Yuen Lee 2024-01-25 06:50:22 +08:00 committed by GitHub
parent 88ccf6d363
commit bfd5aed800
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,16 +1,27 @@
#!/usr/bin/expect #!/usr/bin/expect
## For every 1 character sent, wait 0.001 milliseconds
set send_slow {1 0.001} set send_slow {1 0.001}
## Start the Ox64 BL808 Emulator
spawn ./temu nuttx.cfg spawn ./temu nuttx.cfg
## Wait for the prompt and enter `uname -a`
expect "nsh> " expect "nsh> "
send -s "uname -a\r" send -s "uname -a\r"
## Wait for the prompt and enter `ostest`
expect "nsh> " expect "nsh> "
send -s "ostest\r" send -s "ostest\r"
## Wait at most 120 seconds
set timeout 120 set timeout 120
## Check the response...
expect { expect {
## If we see this message, exit normally
"ostest_main: Exiting with status -1" { exit 0 } "ostest_main: Exiting with status -1" { exit 0 }
## If timeout, exit with an error
timeout { exit 1 } timeout { exit 1 }
} }
exit 2