mirror of
https://github.com/lupyuen/nuttx-sg2000.git
synced 2025-01-12 12:48:28 +08:00
Add expect script
This commit is contained in:
parent
79ece04f9e
commit
c44e25f7a1
2 changed files with 55 additions and 0 deletions
7
nuttx.cfg
Normal file
7
nuttx.cfg
Normal file
|
@ -0,0 +1,7 @@
|
|||
/* VM configuration file */
|
||||
{
|
||||
version: 1,
|
||||
machine: "riscv64",
|
||||
memory_size: 256,
|
||||
bios: "Image",
|
||||
}
|
48
nuttx.exp
Executable file
48
nuttx.exp
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/expect
|
||||
## Expect Script for Testing NuttX with SG2000 Emulator
|
||||
|
||||
## Wait at most 300 seconds
|
||||
set timeout 300
|
||||
|
||||
## For every 1 character sent, wait 0.001 milliseconds
|
||||
set send_slow {1 0.001}
|
||||
|
||||
## Start the SG2000 Emulator
|
||||
spawn ./temu nuttx.cfg
|
||||
|
||||
## Wait for the prompt and enter `uname -a`
|
||||
expect "nsh> "
|
||||
send -s "uname -a\r"
|
||||
|
||||
## Wait for the prompt and enter `free`
|
||||
expect "nsh> "
|
||||
send -s "free\r"
|
||||
|
||||
## Wait for the prompt and enter `hello`
|
||||
expect "nsh> "
|
||||
send -s "hello\r"
|
||||
|
||||
## Wait for the prompt and enter `getprime`
|
||||
expect "nsh> "
|
||||
send -s "getprime\r"
|
||||
|
||||
## Wait for the prompt and enter `hello`
|
||||
expect "nsh> "
|
||||
send -s "hello\r"
|
||||
|
||||
## Wait for the prompt and enter `getprime`
|
||||
expect "nsh> "
|
||||
send -s "getprime\r"
|
||||
|
||||
## Wait for the prompt and enter `ostest`
|
||||
expect "nsh> "
|
||||
send -s "ostest\r"
|
||||
|
||||
## Check the response...
|
||||
expect {
|
||||
## If we see this message, exit normally
|
||||
"ostest_main: Exiting with status 0" { exit 0 }
|
||||
|
||||
## If timeout, exit with an error
|
||||
timeout { exit 1 }
|
||||
}
|
Loading…
Reference in a new issue