proc colorstr {color str} {
if {[color_term]} {
+ set b 0
+ if {[string range $color 0 4] eq {bold-}} {
+ set b 1
+ set color [string range $color 5 end]
+ }
switch $color {
red {set colorcode {31}}
green {set colorcode {32}}
blue {set colorcode {34}}
magenta {set colorcode {35}}
cyan {set colorcode {36}}
- else {set colorcode {37}}
+ white {set colorcode {37}}
+ default {set colorcode {37}}
}
if {$colorcode ne {}} {
- return "\033\[0;${colorcode};40m$str\033\[0m"
+ return "\033\[$b;${colorcode};40m$str\033\[0m"
}
} else {
return $str
set payload [read $fd $bytes]
foreach {status data} $payload break
if {$status eq {ready}} {
- puts "($fd) \[$status\]: $data"
+ puts "\[$status\]: $data"
signal_idle_client $fd
} elseif {$status eq {done}} {
set elapsed [expr {[clock seconds]-$::clients_start_time($fd)}]
- puts "($fd) \[[colorstr yellow $status]\]: $data ($elapsed seconds)"
+ puts "\[[colorstr yellow $status]\]: $data ($elapsed seconds)"
puts "+++ [llength $::active_clients] units still in execution."
lappend ::clients_time_history $elapsed $data
signal_idle_client $fd
} elseif {$status eq {ok}} {
- puts "($fd) \[[colorstr green $status]\]: $data"
+ puts "\[[colorstr green $status]\]: $data"
} elseif {$status eq {err}} {
- puts "($fd) \[[colorstr red $status]\]: $data"
+ puts "\[[colorstr red $status]\]: $data"
} else {
- puts "($fd) \[$status\]: $data"
+ puts "\[$status\]: $data"
}
}
[lsearch -all -inline -not -exact $::active_clients $fd]
# New unit to process?
if {$::next_test != [llength $::all_tests]} {
- puts "Spawing new test process for: [lindex $::all_tests $::next_test]"
+ puts [colorstr bold-white "Testing [lindex $::all_tests $::next_test]"]
set ::clients_start_time($fd) [clock seconds]
send_data_packet $fd run [lindex $::all_tests $::next_test]
lappend ::active_clients $fd