mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
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:
parent
df985bda84
commit
85c6640795
@ -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
|
||||
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
|
||||
}
|
||||
|
@ -200,8 +200,6 @@ proc build_boot_image {binaries} {
|
||||
|
||||
|
||||
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
|
||||
#
|
||||
@ -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
|
||||
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
|
||||
}
|
||||
|
33
tool/run
33
tool/run
@ -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
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user