2 if {$tcl_platform(platform) == "unix"} {
3 fconfigure stdout -translation lf
5 lappend auto_path [file dirname [info script]]
9 proc compare_order {el1 el2} {
11 return [expr {$order($el1)-$order($el2)}]
14 if {$argc} {set statsfile [lindex $argv 0]}
15 set f [open $statsfile]
16 fconfigure $f -encoding utf-8
18 while {[gets $f line] >=0} {
19 set script [lindex $line 0]
20 set a($script) [lrange $line 1 end]
21 if {![info exists order($script)]} {
22 set order($script) [incr ordno]
30 if {[info exists out]} {
36 set out [open [lindex $argv 1] w]
37 fconfigure $out -encoding utf-8
40 output [format "%-12s %-41s%5s %4s %4s %4s %4s" File "Test name" Total ok fail skip ign]
41 output [string repeat "-" 79]
42 array set gross {total 0 ok 0 fail 0 p_skip 0 c_skip 0}
45 foreach script [lsort -command compare_order [array names a] ] {
46 foreach {name total ok fail p_skip c_skip} $a($script) break
47 output [format "%-12s %-41s%5d %4d %4d %4d %4d" [string range [file tail [file rootname $script]] 0 11] [string range $name 0 40] $total $ok $fail $p_skip $c_skip]
48 incr gross(total) $total
50 incr gross(fail) $fail
51 incr gross(p_skip) $p_skip
52 incr gross(c_skip) $c_skip
55 output [string repeat "-" 79]
56 output [format "%-54s%5d %4d %4d %4d %4d" Total $gross(total) $gross(ok) $gross(fail) $gross(p_skip) $gross(c_skip)]