From: antirez Date: Sun, 10 Jul 2011 22:14:12 +0000 (+0200) Subject: display less useless information in parallel test X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/82e5dd35ea99692cc10077be95485242a9b352a3 display less useless information in parallel test --- diff --git a/tests/support/test.tcl b/tests/support/test.tcl index 55236b9a..0fca6182 100644 --- a/tests/support/test.tcl +++ b/tests/support/test.tcl @@ -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 diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl index 5be79564..2bb18bc9 100644 --- a/tests/test_helper.tcl +++ b/tests/test_helper.tcl @@ -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