Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Turbo码先生
redis
提交
3744824c
R
redis
项目概览
Turbo码先生
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3744824c
编写于
7月 11, 2011
作者:
A
antirez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
some test colorization and some fix
上级
36e790a0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
39 deletion
+20
-39
tests/support/test.tcl
tests/support/test.tcl
+11
-37
tests/test_helper.tcl
tests/test_helper.tcl
+9
-2
未找到文件。
tests/support/test.tcl
浏览文件 @
3744824c
...
...
@@ -49,48 +49,22 @@ proc color_term {} {
expr
{[
info exists ::env
(
TERM
)]
&&
[
string match *xterm* $::env
(
TERM
)]}
}
# This is called after the test finished
proc colored_dot
{
tags passed
}
{
proc colorstr
{
color str
}
{
if
{[
color_term
]}
{
# Go backward and delete what announc_test function printed.
puts -nonewline
"
\033\[
${::backward_count}
D
\033\[
0K
\033\[
J"
# Print a coloured char, accordingly to test outcome and tags.
if
{[
lsearch $tags list
]
!= -1
}
{
set colorcode
{
31
}
set ch L
}
elseif
{[
lsearch $tags hash
]
!= -1
}
{
set colorcode
{
32
}
set ch H
}
elseif
{[
lsearch $tags set
]
!= -1
}
{
set colorcode
{
33
}
set ch S
}
elseif
{[
lsearch $tags zset
]
!= -1
}
{
set colorcode
{
34
}
set ch Z
}
elseif
{[
lsearch $tags basic
]
!= -1
}
{
set colorcode
{
35
}
set ch B
}
else
{
set colorcode
{
37
}
set ch .
switch $color
{
red
{
set colorcode
{
31
}}
green
{
set colorcode
{
32
}}
yellow
{
set colorcode
{
33
}}
blue
{
set colorcode
{
34
}}
magenta
{
set colorcode
{
35
}}
cyan
{
set colorcode
{
36
}}
else
{
set colorcode
{
37
}}
}
if
{
$colorcode
ne
{}}
{
if
{
$passed
}
{
puts -nonewline
"
\033\[
0;
${colorcode}
;40m"
}
else
{
puts -nonewline
"
\033\[
7;
${colorcode}
;40m"
}
puts -nonewline $ch
puts -nonewline
"
\033\[
0m"
flush stdout
return
"
\033\[
0;
${colorcode}
;40m
$str
\033\[
0m"
}
}
else
{
if
{
$passed
}
{
puts -nonewline .
}
else
{
puts -nonewline F
}
return $str
}
}
...
...
tests/test_helper.tcl
浏览文件 @
3744824c
...
...
@@ -209,14 +209,21 @@ proc read_from_test_client fd {
set bytes
[
gets $fd
]
set payload
[
read $fd $bytes
]
foreach
{
status data
}
$payload break
puts
"(
$fd
)
\[
$status
\]
:
$data
"
if
{
$status
eq
{
ready
}}
{
puts
"(
$fd
)
\[
$status
\]
:
$data
"
signal_idle_client $fd
}
elseif
{
$status
eq
{
done
}}
{
set elapsed
[
expr
{[
clock seconds
]
-$::clients_start_time
(
$fd
)}]
puts
"+++
[
llength $::active_clients
]
units still in execution (
$elapsed
seconds)."
puts
"(
$fd
)
\[
[
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
"
}
elseif
{
$status
eq
{
err
}}
{
puts
"(
$fd
)
\[
[
colorstr red $status
]
\]
:
$data
"
}
else
{
puts
"(
$fd
)
\[
$status
\]
:
$data
"
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录