-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
nuttx.exp
executable file
·48 lines (36 loc) · 981 Bytes
/
nuttx.exp
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
#!/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.01 milliseconds
set send_slow {1 0.01}
## 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 }
}