#!/usr/bin/expect ## Expect Script for Testing NuttX with Ox64 BL808 Emulator ## Wait at most 30 seconds set timeout 30 ## For every 1 character sent, wait 0.001 milliseconds set send_slow {1 0.001} ## Start the Ox64 BL808 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 } }