OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [lib/] [timeout.exp] - Blame information for rev 315

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 306 jeremybenn
# Copyright (C) 2008 Free Software Foundation, Inc.
2
 
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.
7
#
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.
12
#
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
# .
16
 
17
#
18
# unset_timeout_vars -- Unset variables used for timeouts
19
#
20
 
21
proc unset_timeout_vars { args } {
22
    global individual_timeout
23
    global timeout_factor
24
 
25
    if [info exists individual_timeout] {
26
        unset individual_timeout
27
    }
28
    if [info exists timeout_factor] {
29
        unset timeout_factor
30
    }
31
}
32
 
33
#
34
# timeout_value -- Return the integer timeout value to use for this test
35
#
36
 
37
proc timeout_value { args } {
38
    global tool_timeout
39
    global individual_timeout
40
    global timeout_factor
41
 
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] {
46
        set val $tool_timeout
47
    } elseif [target_info exists gcc,timeout] {
48
        set val [target_info gcc,timeout]
49
    } else {
50
        # This is really, REALLY ugly, but this is the default from
51
        # remote.exp deep within DejaGnu.
52
        set val 300
53
    }
54
 
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])]
58
    }
59
 
60
    return $val
61
}
62
 
63
#
64
# standard_wait -- Set the timeout value used by DejaGnu
65
#
66
 
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.
70
 
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]
76
        if { $val != 0 } {
77
            set timeout $val
78
        }
79
        saved_standard_wait $dest $timeout
80
    }
81
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.