3 wm title . "WvTest Progress"
9 set totalfile ".wvtest-total"
10 if [file exists $totalfile] {
11 set f [open $totalfile r]
19 set monofont [font create -family Courier]
20 set monobold [font create -family Courier -weight bold]
22 label .title -font $font -text "WvTest Progress"
26 label .f.t1 -font $font -text "Total:" -font $font
27 label .f.t2 -font $font -textvariable total
28 label .f.p1 -font $font -text "Pass:"
29 label .f.p2 -font $font -textvariable pass
30 label .f.f1 -font $font -text "Fail:"
31 label .f.f2 -font $font -textvariable fail
32 pack .f.t1 .f.t2 .f.p1 .f.p2 .f.f1 .f.f2 -side left
36 label .f2.f1 -font $font -text "Testing:"
37 label .f2.f2 -font $font -textvariable file
38 label .f2.f3 -font $font -textvariable sub
39 pack .f2.f1 .f2.f2 .f2.f3 -side left
42 scrollbar .s -orient h -width 20
43 pack .s -fill x -padx 5 -pady 5
46 button .b.logbutton -command showlogs -text "View full log" -relief groove
47 button .b.closebutton -command {destroy .} -text "Close" -relief groove
48 pack .b.logbutton .b.closebutton -side left
52 pack .l -padx 5 -pady 5 -expand on -fill both
54 scrollbar .l.s -orient v -command {.l.log yview}
55 pack .l.s -side right -fill y
56 text .l.log -font $monofont -yscrollcommand {.l.s set}
57 .l.log tag configure bold -font $monobold -foreground red
58 pack .l.log -fill both -expand on -side left
65 .l.log insert end $fulllog
68 proc addend {text args} {
70 .l.log insert end $text $args
76 global total xtotal pass fail fulllog
79 # increment progress bar
80 .s set 0 [expr 1.0*$total/$xtotal]
83 .s config -background red -activebackground red
85 .s config -background green -activebackground green
90 bind . <Key-Escape> {destroy .}
91 bind . <Key-Return> {destroy .}
95 fileevent stdin readable {
100 if [regexp {^Testing "(.*)" in (.*):$} $line junk sub file] {
101 addend [format "%-25s %-45s\n" $file $sub]
102 } elseif [regexp {^! } $line] {
103 if [regexp {[ \t]([^ \t]+)$} $line junk result] {
104 # addend "file='$file', result='$result'\n"
109 addend "$line\n" bold
116 append fulllog " $line\n"
118 after idle {fix_progbar}
121 fileevent stdin readable {}
128 addend "\nAll tests complete: $total total, $pass passes, $fail failures.\n"
132 .b.closebutton config -background red -relief raised
134 set f [open $totalfile w]
138 .b.closebutton config -background green -relief raised