Last change
on this file since 120 was
73,
checked in by ajj, 16 years ago
|
Adding inital test code using expectk
|
-
Property svn:executable set to
*
|
File size:
909 bytes
|
Line | |
---|
1 | #!/usr/bin/expectk |
---|
2 | |
---|
3 | #log_user 0 |
---|
4 | eval spawn -noecho "/usr/local/icp/bin/icp" |
---|
5 | set icpid $spawn_id |
---|
6 | #canvas .icp -relief sunken -bd 1 -width 600 |
---|
7 | #set icptext [.icp create text 0 0 -anchor w -font Fixed -width 0] |
---|
8 | text .icp |
---|
9 | entry .input -relief sunken -bd 1 |
---|
10 | button .howlongbut -text "Howlong i1-6" -command {exp_send -i $icpid "howlong i1-6\r"} |
---|
11 | |
---|
12 | pack .icp -fill x -anchor nw -expand true |
---|
13 | pack .input -fill x |
---|
14 | pack .howlongbut |
---|
15 | |
---|
16 | |
---|
17 | expect_background { |
---|
18 | -i $icpid -re "\[^\x0d]+" { |
---|
19 | #.icp insert $icptext end $expect_out(0,string) |
---|
20 | .icp insert end $expect_out(0,string) |
---|
21 | } |
---|
22 | -i $any_spawn_id "\x0d" { |
---|
23 | } |
---|
24 | -i $any_spawn_id "exit" { exit 0 } |
---|
25 | } |
---|
26 | |
---|
27 | foreach event {<KeyPress> <<PasteSelection>>} {bind .icp $event break} |
---|
28 | bind .input <Any-Enter> {focus %W} |
---|
29 | bind .input <Key-Return> {exp_send -i $icpid [ .input get]; exp_send -i $icpid "\r"; .input delete 0 end } |
---|
Note: See
TracBrowser
for help on using the repository browser.