Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
82e5dd35
Commit
82e5dd35
authored
Jul 11, 2011
by
antirez
Browse files
display less useless information in parallel test
parent
3744824c
Changes
2
Show whitespace changes
Inline
Side-by-side
tests/support/test.tcl
View file @
82e5dd35
...
@@ -51,6 +51,11 @@ proc color_term {} {
...
@@ -51,6 +51,11 @@ proc color_term {} {
proc colorstr
{
color str
}
{
proc colorstr
{
color str
}
{
if
{[
color_term
]}
{
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
{
switch $color
{
red
{
set colorcode
{
31
}}
red
{
set colorcode
{
31
}}
green
{
set colorcode
{
32
}}
green
{
set colorcode
{
32
}}
...
@@ -58,10 +63,11 @@ proc colorstr {color str} {
...
@@ -58,10 +63,11 @@ proc colorstr {color str} {
blue
{
set colorcode
{
34
}}
blue
{
set colorcode
{
34
}}
magenta
{
set colorcode
{
35
}}
magenta
{
set colorcode
{
35
}}
cyan
{
set colorcode
{
36
}}
cyan
{
set colorcode
{
36
}}
else
{
set colorcode
{
37
}}
white
{
set colorcode
{
37
}}
default
{
set colorcode
{
37
}}
}
}
if
{
$colorcode
ne
{}}
{
if
{
$colorcode
ne
{}}
{
return
"
\033\[
0
;
${colorcode}
;40m
$str
\033\[
0m"
return
"
\033\[
$b
;
${colorcode}
;40m
$str
\033\[
0m"
}
}
}
else
{
}
else
{
return $str
return $str
...
...
tests/test_helper.tcl
View file @
82e5dd35
...
@@ -210,20 +210,20 @@ proc read_from_test_client fd {
...
@@ -210,20 +210,20 @@ proc read_from_test_client fd {
set payload
[
read $fd $bytes
]
set payload
[
read $fd $bytes
]
foreach
{
status data
}
$payload break
foreach
{
status data
}
$payload break
if
{
$status
eq
{
ready
}}
{
if
{
$status
eq
{
ready
}}
{
puts
"
(
$fd
)
\[
$status
\]
:
$data
"
puts
"
\[
$status
\]
:
$data
"
signal_idle_client $fd
signal_idle_client $fd
}
elseif
{
$status
eq
{
done
}}
{
}
elseif
{
$status
eq
{
done
}}
{
set elapsed
[
expr
{[
clock seconds
]
-$::clients_start_time
(
$fd
)}]
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."
puts
"+++
[
llength $::active_clients
]
units still in execution."
lappend ::clients_time_history $elapsed $data
lappend ::clients_time_history $elapsed $data
signal_idle_client $fd
signal_idle_client $fd
}
elseif
{
$status
eq
{
ok
}}
{
}
elseif
{
$status
eq
{
ok
}}
{
puts
"
(
$fd
)
\[
[
colorstr green $status
]
\]
:
$data
"
puts
"
\[
[
colorstr green $status
]
\]
:
$data
"
}
elseif
{
$status
eq
{
err
}}
{
}
elseif
{
$status
eq
{
err
}}
{
puts
"
(
$fd
)
\[
[
colorstr red $status
]
\]
:
$data
"
puts
"
\[
[
colorstr red $status
]
\]
:
$data
"
}
else
{
}
else
{
puts
"
(
$fd
)
\[
$status
\]
:
$data
"
puts
"
\[
$status
\]
:
$data
"
}
}
}
}
...
@@ -235,7 +235,7 @@ proc signal_idle_client fd {
...
@@ -235,7 +235,7 @@ proc signal_idle_client fd {
[
lsearch -all -inline -not -exact $::active_clients $fd
]
[
lsearch -all -inline -not -exact $::active_clients $fd
]
# New unit to process?
# New unit to process?
if
{
$::next
_test !=
[
llength $::all_tests
]}
{
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
]
set ::clients_start_time
(
$fd
)
[
clock seconds
]
send_data_packet $fd run
[
lindex $::all_tests $::next_test
]
send_data_packet $fd run
[
lindex $::all_tests $::next_test
]
lappend ::active_clients $fd
lappend ::active_clients $fd
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment