1 # Copyright (C) 2008 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with GCC; see the file COPYING3. If not see
15 # <http://www.gnu.org/licenses/>.
18 # unset_timeout_vars -- Unset variables used for timeouts
21 proc unset_timeout_vars { args } {
22 global individual_timeout
25 if [info exists individual_timeout] {
26 unset individual_timeout
28 if [info exists timeout_factor] {
34 # timeout_value -- Return the integer timeout value to use for this test
37 proc timeout_value { args } {
39 global individual_timeout
42 # Find the current timeout limit, in seconds.
43 if [info exists individual_timeout] {
44 set val $individual_timeout
45 } elseif [info exists tool_timeout] {
47 } elseif [target_info exists gcc,timeout] {
48 set val [target_info gcc,timeout]
50 # This is really, REALLY ugly, but this is the default from
51 # remote.exp deep within DejaGnu.
55 # If the test specified a timeout factor, adjust by that.
56 if [info exists timeout_factor] {
57 set val [expr int([expr $val * $timeout_factor])]
64 # standard_wait -- Set the timeout value used by DejaGnu
67 # Override standard_wait from DejaGnu to use timeout value specified by
68 # by the user or by the target board, possibly multiplied by a factor
69 # for a particular test.
71 if { [info procs standard_wait] != [list] \
72 && [info procs saved_standard_wait] == [list] } {
73 rename standard_wait saved_standard_wait
74 proc standard_wait { dest timeout } {
75 set val [timeout_value]
79 saved_standard_wait $dest $timeout