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. */ |
84 |
set EXPECT [findfile $base_dir/../../expect/expect "$base_dir/../../expect/expect" expect] |
set EXPECT [findfile $base_dir/../../expect/expect "$base_dir/../../expect/expect" expect] |
85 |
verbose "EXPECT defaulting to $EXPECT" 2 |
verbose "EXPECT defaulting to $EXPECT" 2 |
86 |
} |
} |
87 |
|
|
88 |
# catch close |
# catch close |
89 |
# catch wait |
# catch wait |
90 |
|
|
99 |
return -1 |
return -1 |
100 |
} |
} |
101 |
} |
} |
102 |
|
|
103 |
# Load the defaults file |
# Load the defaults file |
104 |
exp_send "source ${defaults_file}\n" |
exp_send "source ${defaults_file}\n" |
105 |
expect { |
expect { |
119 |
# |
# |
120 |
proc stop_expect { } { |
proc stop_expect { } { |
121 |
global spawn_id |
global spawn_id |
122 |
|
|
123 |
# make expect exit |
# make expect exit |
124 |
exp_send "exit\n" |
exp_send "exit\n" |
125 |
catch "close -i $spawn_id" |
catch "close -i $spawn_id" |
148 |
# |
# |
149 |
proc exp_test { cmd pattern msg } { |
proc exp_test { cmd pattern msg } { |
150 |
global spawn_id |
global spawn_id |
151 |
|
|
152 |
exp_send "puts ACK ; $cmd ; puts NAK\r\n" |
exp_send "puts ACK ; $cmd ; puts NAK\r\n" |
153 |
expect { |
expect { |
154 |
"puts ACK*puts NAK" { |
"puts ACK*puts NAK" { |
158 |
warning "Never got command echo" |
warning "Never got command echo" |
159 |
} |
} |
160 |
} |
} |
161 |
|
|
162 |
expect { |
expect { |
163 |
"ACK" { |
"ACK" { |
164 |
exp_continue |
exp_continue |
196 |
warning "Never got command echo" |
warning "Never got command echo" |
197 |
} |
} |
198 |
} |
} |
199 |
|
|
200 |
expect { |
expect { |
201 |
-re "Checking pattern*with*\[\r\n\]" { |
-re "Checking pattern*with*\[\r\n\]" { |
202 |
exp_continue |
exp_continue |