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

@@ -486,6 +486,7 @@ proc spawn_qemu { wait_for_re timeout_value } {
wait_for_output $wait_for_re $timeout_value $qemu_spawn_id
}
##
# Check whether Qemu support is available
#
@@ -501,6 +502,7 @@ proc is_qemu_available { } {
return true
}
##
# 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
#
@@ -596,6 +610,25 @@ proc spawn_amt { wait_for_re timeout_value} {
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
#