4 |
# it under the terms of the GNU General Public License as published by |
# it under the terms of the GNU General Public License as published by |
5 |
# the Free Software Foundation; either version 2 of the License, or |
# the Free Software Foundation; either version 2 of the License, or |
6 |
# (at your option) any later version. |
# (at your option) any later version. |
7 |
# |
# |
8 |
# This program is distributed in the hope that it will be useful, |
# This program is distributed in the hope that it will be useful, |
9 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 |
# GNU General Public License for more details. |
# GNU General Public License for more details. |
12 |
# |
# |
13 |
# You should have received a copy of the GNU General Public License |
# You should have received a copy of the GNU General Public License |
14 |
# along with this program; if not, write to the Free Software |
# along with this program; if not, write to the Free Software |
15 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
16 |
|
|
17 |
# Please email any bugs, comments, and/or additions to this file to: |
# Please email any bugs, comments, and/or additions to this file to: |
18 |
# bug-dejagnu@gnu.org |
# bug-dejagnu@gnu.org |
86 |
set EXPECT [findfile $base_dir/../../expect/expect "$base_dir/../../expect/expect" expect] |
set EXPECT [findfile $base_dir/../../expect/expect "$base_dir/../../expect/expect" expect] |
87 |
verbose "EXPECT defaulting to $EXPECT" 2 |
verbose "EXPECT defaulting to $EXPECT" 2 |
88 |
} |
} |
89 |
|
|
90 |
# catch close |
# catch close |
91 |
# catch wait |
# catch wait |
92 |
|
|
101 |
return -1 |
return -1 |
102 |
} |
} |
103 |
} |
} |
104 |
|
|
105 |
# Load the defaults file |
# Load the defaults file |
106 |
exp_send "source ${defaults_file}\n" |
exp_send "source ${defaults_file}\n" |
107 |
expect { |
expect { |
121 |
# |
# |
122 |
proc stop_expect { } { |
proc stop_expect { } { |
123 |
global spawn_id |
global spawn_id |
124 |
|
|
125 |
# make expect exit |
# make expect exit |
126 |
exp_send "exit\n" |
exp_send "exit\n" |
127 |
catch "close -i $spawn_id" |
catch "close -i $spawn_id" |
150 |
# |
# |
151 |
proc exp_test { cmd pattern msg } { |
proc exp_test { cmd pattern msg } { |
152 |
global spawn_id |
global spawn_id |
153 |
|
|
154 |
exp_send "puts ACK ; $cmd ; puts NAK\r\n" |
exp_send "puts ACK ; $cmd ; puts NAK\r\n" |
155 |
expect { |
expect { |
156 |
"puts ACK*puts NAK" { |
"puts ACK*puts NAK" { |
160 |
warning "Never got command echo" |
warning "Never got command echo" |
161 |
} |
} |
162 |
} |
} |
163 |
|
|
164 |
expect { |
expect { |
165 |
"ACK" { |
"ACK" { |
166 |
exp_continue |
exp_continue |
198 |
warning "Never got command echo" |
warning "Never got command echo" |
199 |
} |
} |
200 |
} |
} |
201 |
|
|
202 |
expect { |
expect { |
203 |
-re "Checking pattern*with*\[\r\n\]" { |
-re "Checking pattern*with*\[\r\n\]" { |
204 |
exp_continue |
exp_continue |