run: add support to specify 'serial' via RUN_OPT

If the target machine is connected locally one may specify
"serial" as target in the RUN_OPT variable to get the test output.

Used for panda and arndale on foc and hw.
This commit is contained in:
Alexander Boettcher 2013-04-16 16:03:16 +02:00 committed by Norman Feske
parent df985bda84
commit 85c6640795
3 changed files with 46 additions and 2 deletions

View File

@ -298,4 +298,12 @@ proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id
spawn_qemu $wait_for_re $timeout_value spawn_qemu $wait_for_re $timeout_value
return return
} }
if {[is_serial_available]} {
spawn_serial $wait_for_re $timeout_value
return
}
global run_target
puts stderr "Error: Can't execute automatically on target '$run_target'"
exit -1
} }

View File

@ -200,8 +200,6 @@ proc build_boot_image {binaries} {
proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} { proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} {
global run_target
# #
# If a running_spawn_id is specified, wait for the expected output # If a running_spawn_id is specified, wait for the expected output
# #
@ -217,7 +215,12 @@ proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id
spawn_qemu $wait_for_re $timeout_value spawn_qemu $wait_for_re $timeout_value
return return
} }
if {[is_serial_available]} {
spawn_serial $wait_for_re $timeout_value
return
}
global run_target
puts stderr "Error: Can't execute automatically on target '$run_target'" puts stderr "Error: Can't execute automatically on target '$run_target'"
exit -1 exit -1
} }

View File

@ -486,6 +486,7 @@ proc spawn_qemu { wait_for_re timeout_value } {
wait_for_output $wait_for_re $timeout_value $qemu_spawn_id wait_for_output $wait_for_re $timeout_value $qemu_spawn_id
} }
## ##
# Check whether Qemu support is available # Check whether Qemu support is available
# #
@ -501,6 +502,7 @@ proc is_qemu_available { } {
return true return true
} }
## ##
# Check whether AMT support is available # Check whether AMT support is available
# #
@ -520,6 +522,18 @@ proc is_amt_available { } {
} }
##
# Check whether output is expected via a local attached serial device
#
proc is_serial_available { } {
global run_target
if {![regexp "serial" $run_target]} { return false }
return true
}
## ##
# Execute scenario using Intel's AMT # Execute scenario using Intel's AMT
# #
@ -596,6 +610,25 @@ proc spawn_amt { wait_for_re timeout_value} {
set output $expect_out(buffer) set output $expect_out(buffer)
} }
##
# Execute scenario expecting output via serial device
#
proc spawn_serial { wait_for_re timeout_value} {
global spawn_id
if {$wait_for_re != "forever"} {
set timeout_value [expr $timeout_value + 30]
}
set serial_dev [get_cmd_arg --serial-dev "/dev/ttyUSB0"]
spawn picocom -b 115200 $serial_dev
set serial_spawn_id $spawn_id
wait_for_output $wait_for_re $timeout_value $serial_spawn_id
}
## ##
# Determine terminal program # Determine terminal program
# #