aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@embecosm.com>2023-12-12 13:09:37 +0000
committerJacob Bachmeyer <jcb@gnu.org>2023-12-12 20:45:58 -0600
commit4d924d484a06e8b463fff966297f87a1eabc21bd (patch)
tree6da8b1073a3df764ba0db2766ed6d55d8b51adcb /config
parent68464b73fdbb474fce995b68140293e4f6b2b61c (diff)
downloaddejagnu-4d924d484a06e8b463fff966297f87a1eabc21bd.zip
dejagnu-4d924d484a06e8b463fff966297f87a1eabc21bd.tar.gz
dejagnu-4d924d484a06e8b463fff966297f87a1eabc21bd.tar.bz2
Do not set `test_timeout' in `unix_load'
The `test_timeout' global parameter is expected to be optionally set by a board description file and then taken into account by `unix_load' to override the default of 300. However not only the procedure checks for the override but it sets the global parameter to the default as well if not present. This might make a minuscule TCL interpreter execution time reduction, but seems rather awkward from the programming style's point of view, and may cause undesired effects if the parameter is referred elsewhere. Remove the setting of the global parameter then, while retaining its semantics. * config/unix.exp (unix_load): Don't ever set `test_timeout', just use it locally.
Diffstat (limited to 'config')
-rw-r--r--config/unix.exp9
1 files changed, 5 insertions, 4 deletions
diff --git a/config/unix.exp b/config/unix.exp
index dc3f781..a3b1a10 100644
--- a/config/unix.exp
+++ b/config/unix.exp
@@ -38,8 +38,9 @@ proc unix_load { dest prog args } {
set output ""
set orig_ld_library_path ""
- if {![info exists test_timeout]} {
- set test_timeout 300
+ set wait_timeout 300
+ if {[info exists test_timeout]} {
+ set wait_timeout $test_timeout
}
if { [llength $args] > 0 } {
@@ -76,7 +77,7 @@ proc unix_load { dest prog args } {
setenv LD_LIBRARY_PATH $ld_library_path:$orig_ld_library_path
setenv SHLIB_PATH $ld_library_path:$orig_ld_library_path
verbose -log "Setting LD_LIBRARY_PATH to $ld_library_path:$orig_ld_library_path" 2
- verbose -log "Execution timeout is: $test_timeout" 2
+ verbose -log "Execution timeout is: $wait_timeout" 2
# Prepend shell name (e.g., qemu emulator) to the command.
if {[board_info $dest exists exec_shell]} {
@@ -88,7 +89,7 @@ proc unix_load { dest prog args } {
set output "remote_spawn failed"
set status -1
} else {
- set status [remote_wait $dest $test_timeout]
+ set status [remote_wait $dest $wait_timeout]
set output [lindex $status 1]
set status [lindex $status 0]
}