source: sans/utils/bt5/icpgui/test2 @ 120

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
4eval spawn -noecho "/usr/local/icp/bin/icp"
5set 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]
8text .icp
9entry .input -relief sunken -bd 1
10button .howlongbut -text "Howlong i1-6" -command {exp_send -i $icpid "howlong i1-6\r"}
11
12pack .icp -fill x -anchor nw -expand true
13pack .input -fill x
14pack .howlongbut
15
16
17expect_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
27foreach event {<KeyPress> <<PasteSelection>>} {bind .icp $event break}
28bind .input <Any-Enter> {focus %W}
29bind .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.