diff --git a/base-codezero/run/env b/base-codezero/run/env index bfdaec3ab1..94d16cb8b6 100644 --- a/base-codezero/run/env +++ b/base-codezero/run/env @@ -83,6 +83,24 @@ proc build_boot_image {binaries} { } -proc run_genode_until {{wait_for_re forever} {timeout_value 0}} { - spawn_qemu $wait_for_re $timeout_value } +proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} { + # + # If a running_spawn_id is specified, wait for the expected output + # + if {$running_spawn_id != -1} { + wait_for_output $wait_for_re $timeout_value $running_spawn_id + return + } + # + # Try to use one of the supported backends for running the scripts + # + if {[is_qemu_available]} { + spawn_qemu $wait_for_re $timeout_value + return + } + + global run_target + puts stderr "Error: Can't execute automatically on target '$run_target'" + exit -1 +} diff --git a/base-fiasco/run/env b/base-fiasco/run/env index 9570743765..bd30b38332 100644 --- a/base-fiasco/run/env +++ b/base-fiasco/run/env @@ -172,10 +172,28 @@ proc build_boot_image {binaries} { } -proc run_genode_until {{wait_for_re forever} {timeout_value 0}} { - if {[is_amt_available]} { - spawn_amt $wait_for_re $timeout_value; - } else { - spawn_qemu $wait_for_re $timeout_value; +proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} { + # + # If a running_spawn_id is specified, wait for the expected output + # + if {$running_spawn_id != -1} { + wait_for_output $wait_for_re $timeout_value $running_spawn_id + return } + + # + # Try to use one of the supported backends for running the scripts + # + if {[is_amt_available]} { + spawn_amt $wait_for_re $timeout_value + return + } + if {[is_qemu_available]} { + spawn_qemu $wait_for_re $timeout_value + return + } + + global run_target + puts stderr "Error: Can't execute automatically on target '$run_target'" + exit -1 } diff --git a/base-foc/run/env b/base-foc/run/env index e1f851b89b..f33b4e2455 100644 --- a/base-foc/run/env +++ b/base-foc/run/env @@ -278,10 +278,24 @@ proc build_boot_image {binaries} { } -proc run_genode_until {{wait_for_re forever} {timeout_value 0}} { +proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} { + # + # If a running_spawn_id is specified, wait for the expected output + # + if {$running_spawn_id != -1} { + wait_for_output $wait_for_re $timeout_value $running_spawn_id + return + } + + # + # Try to use one of the supported backends for running the scripts + # if {[is_amt_available]} { - spawn_amt $wait_for_re $timeout_value; - } else { - spawn_qemu $wait_for_re $timeout_value; + spawn_amt $wait_for_re $timeout_value + return + } + if {[is_qemu_available]} { + spawn_qemu $wait_for_re $timeout_value + return } } diff --git a/base-hw/run/env b/base-hw/run/env index 6787459529..433c19f7bb 100644 --- a/base-hw/run/env +++ b/base-hw/run/env @@ -204,7 +204,26 @@ proc build_boot_image {binaries} { } -proc run_genode_until {{wait_for_re forever} {timeout_value 0}} { +proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} { + # + # If a running_spawn_id is specified, wait for the expected output + # + if {$running_spawn_id != -1} { + wait_for_output $wait_for_re $timeout_value $running_spawn_id + return + } + + # + # Try to use one of the supported backends for running the scripts + # +# if {[is_amt_available]} { +# spawn_amt $wait_for_re $timeout_value +# return +# } +# if {[is_qemu_available]} { +# spawn_qemu $wait_for_re $timeout_value +# return +# } if {[target] == "qemu"} { spawn_qemu $wait_for_re $timeout_value } else { diff --git a/base-linux/run/env b/base-linux/run/env index 675a451323..ad701b04b9 100644 --- a/base-linux/run/env +++ b/base-linux/run/env @@ -26,7 +26,15 @@ proc build_boot_image {binaries} { } -proc run_genode_until {{wait_for_re forever} {timeout_value 0}} { +proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} { + # + # If a running_spawn_id is specified, wait for the expected output + # + if {$running_spawn_id != -1} { + wait_for_output $wait_for_re $timeout_value $running_spawn_id + return + } + global output set timeout $timeout_value set orig_pwd [pwd] diff --git a/base-nova/run/env b/base-nova/run/env index 31fe477cf3..a78beb3f13 100644 --- a/base-nova/run/env +++ b/base-nova/run/env @@ -118,10 +118,24 @@ proc build_boot_image {binaries} { } -proc run_genode_until {{wait_for_re forever} {timeout_value 0}} { +proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} { + # + # If a running_spawn_id is specified, wait for the expected output + # + if {$running_spawn_id != -1} { + wait_for_output $wait_for_re $timeout_value $running_spawn_id + return + } + + # + # Try to use one of the supported backends for running the scripts + # if {[is_amt_available]} { - spawn_amt $wait_for_re $timeout_value; - } else { - spawn_qemu $wait_for_re $timeout_value; + spawn_amt $wait_for_re $timeout_value + return + } + if {[is_qemu_available]} { + spawn_qemu $wait_for_re $timeout_value + return } } diff --git a/base-okl4/run/env b/base-okl4/run/env index 9f2904506d..7e5fb0085b 100644 --- a/base-okl4/run/env +++ b/base-okl4/run/env @@ -235,10 +235,28 @@ proc build_boot_image {binaries} { } -proc run_genode_until {{wait_for_re forever} {timeout_value 0}} { - if {[is_amt_available]} { - spawn_amt $wait_for_re $timeout_value; - } else { - spawn_qemu $wait_for_re $timeout_value; +proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} { + # + # If a running_spawn_id is specified, wait for the expected output + # + if {$running_spawn_id != -1} { + wait_for_output $wait_for_re $timeout_value $running_spawn_id + return } + + # + # Try to use one of the supported backends for running the scripts + # + if {[is_amt_available]} { + spawn_amt $wait_for_re $timeout_value + return + } + if {[is_qemu_available]} { + spawn_qemu $wait_for_re $timeout_value + return + } + + global run_target + puts stderr "Error: Can't execute automatically on target '$run_target'" + exit -1 } diff --git a/base-pistachio/run/env b/base-pistachio/run/env index 890a014fe1..c0ce135295 100644 --- a/base-pistachio/run/env +++ b/base-pistachio/run/env @@ -151,10 +151,28 @@ proc build_boot_image {binaries} { } -proc run_genode_until {{wait_for_re forever} {timeout_value 0}} { - if {[is_amt_available]} { - spawn_amt $wait_for_re $timeout_value; - } else { - spawn_qemu $wait_for_re $timeout_value; +proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} { + # + # If a running_spawn_id is specified, wait for the expected output + # + if {$running_spawn_id != -1} { + wait_for_output $wait_for_re $timeout_value $running_spawn_id + return } + + # + # Try to use one of the supported backends for running the scripts + # + if {[is_amt_available]} { + spawn_amt $wait_for_re $timeout_value + return + } + if {[is_qemu_available]} { + spawn_qemu $wait_for_re $timeout_value + return + } + + global run_target + puts stderr "Error: Can't execute automatically on target '$run_target'" + exit -1 } diff --git a/tool/run b/tool/run index a16654631d..5947250fb6 100755 --- a/tool/run +++ b/tool/run @@ -111,6 +111,7 @@ proc build_boot_image {binaries} { } # # \param wait_for_re regular expression that matches the test completion # \param timeout_value timeout in seconds +# \param spawn_id spawn_id of a already running and spawned process # \global output contains the core output (modified) # # If the function is called without any argument, Genode is executed in @@ -122,7 +123,7 @@ proc build_boot_image {binaries} { } # This function must be implemented by the platform-specific test environment. # If not implemented, the program exits with the error code -3. # -proc run_genode_until {{wait_for_re forever} {timeout_value 0}} { +proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} { puts stderr "Error: 'run_genode_until' is not implemented for this platform" exit -3 } @@ -420,7 +421,7 @@ proc wait_for_output { wait_for_re timeout_value running_spawn_id } { expect { -i $running_spawn_id -re $wait_for_re { } - eof { puts stderr "Error: Qemu died unexpectedly"; exit -3 } + eof { puts stderr "Error: Spawned process died unexpectedly"; exit -3 } timeout { puts stderr "Error: Test execution timed out"; exit -2 } } set output $expect_out(buffer)