mirror of
https://github.com/kelvinlawson/atomthreads.git
synced 2026-01-11 18:33:16 +01:00
AVR: Add expect script to run test in simavr and check for success.
This commit is contained in:
31
ports/avr/run_test.exp
Executable file
31
ports/avr/run_test.exp
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env expect
|
||||
|
||||
# Start the test (arguments: <path_to_simavr> <cpu_part> <test_elf_file>)
|
||||
spawn [lindex $argv 0] -m [lindex $argv 1] [lindex $argv 2]
|
||||
|
||||
# Expect to see the test starting within 10 seconds
|
||||
set timeout 10
|
||||
|
||||
# Wait for the test to start ("Go..")
|
||||
expect {
|
||||
"Go.." {
|
||||
puts "Test started"
|
||||
|
||||
# The test could take up to 3 minutes to complete once started
|
||||
set timeout 180
|
||||
|
||||
# Now expect to see "Pass.." or "Fail" within 3 minutes
|
||||
expect {
|
||||
"Pass.." { puts "Test passed"; exit 0 }
|
||||
"Fail" { puts "Test failed"; exit 1 }
|
||||
timeout { puts "Test timed out without completing"; exit 1 }
|
||||
}
|
||||
}
|
||||
|
||||
timeout {
|
||||
# Didn't receive "Go.." within 10 seconds
|
||||
puts "Test failed to start ('Go' not seen)"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user