提交 82e5dd35 编写于 作者: A antirez

display less useless information in parallel test

上级 3744824c
......@@ -51,6 +51,11 @@ proc color_term {} {
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}}
......@@ -58,10 +63,11 @@ proc colorstr {color str} {
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
......
......@@ -210,20 +210,20 @@ proc read_from_test_client fd {
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"
}
}
......@@ -235,7 +235,7 @@ proc signal_idle_client fd {
[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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册