Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
3bf9bd76
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
12 个月 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3bf9bd76
编写于
7月 19, 2019
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format output
上级
b860e2b0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
6 deletion
+14
-6
src/biz/check.go
src/biz/check.go
+6
-2
src/biz/report.go
src/biz/report.go
+8
-4
未找到文件。
src/biz/check.go
浏览文件 @
3bf9bd76
...
...
@@ -6,6 +6,7 @@ import (
"github.com/easysoft/zentaoatf/src/model"
"github.com/easysoft/zentaoatf/src/utils"
"github.com/fatih/color"
"regexp"
)
func
CheckResults
(
files
[]
string
,
dir
string
,
langType
string
,
report
*
model
.
TestReport
)
{
...
...
@@ -44,9 +45,12 @@ func ValidateTestCase(scriptFile string, langType string,
actualLines
=
actualArr
[
indx
]
}
re
,
_
:=
regexp
.
Compile
(
`\s{2,}`
)
step
=
re
.
ReplaceAllString
(
step
,
" "
)
stepResult
,
checkpointLogs
:=
ValidateStep
(
langType
,
expectLines
,
actualLines
)
step
:=
model
.
StepLog
{
Numb
:
indx
+
1
,
Name
:
step
,
Status
:
stepResult
,
CheckPoints
:
checkpointLogs
}
stepLogs
=
append
(
stepLogs
,
step
)
step
Log
:=
model
.
StepLog
{
Numb
:
indx
+
1
,
Name
:
step
,
Status
:
stepResult
,
CheckPoints
:
checkpointLogs
}
stepLogs
=
append
(
stepLogs
,
step
Log
)
if
!
stepResult
{
caseResult
=
misc
.
FAIL
}
...
...
src/biz/report.go
浏览文件 @
3bf9bd76
...
...
@@ -40,12 +40,12 @@ func Print(report model.TestReport, workDir string) {
PrintAndLog
(
&
logs
,
""
)
}
str
:=
" %s
%d %s:
%s"
str
:=
" %s
%d: %s
%s"
status
:=
utils
.
BoolToPass
(
step
.
Status
)
statusColor
:=
colorStatus
(
status
)
logs
=
append
(
logs
,
fmt
.
Sprintf
(
str
,
utils
.
I118Prt
.
Sprintf
(
"step"
),
step
.
Numb
,
st
ep
.
Name
,
status
))
fmt
.
Printf
(
str
,
utils
.
I118Prt
.
Sprintf
(
"step"
),
step
.
Numb
,
st
ep
.
Name
,
statusColor
+
"
\n
"
)
logs
=
append
(
logs
,
fmt
.
Sprintf
(
str
,
utils
.
I118Prt
.
Sprintf
(
"step"
),
step
.
Numb
,
st
atus
,
step
.
Name
))
fmt
.
Printf
(
str
,
utils
.
I118Prt
.
Sprintf
(
"step"
),
step
.
Numb
,
st
atusColor
,
step
.
Name
+
"
\n
"
)
count1
:=
0
for
_
,
cp
:=
range
step
.
CheckPoints
{
...
...
@@ -53,8 +53,12 @@ func Print(report model.TestReport, workDir string) {
PrintAndLog
(
&
logs
,
""
)
}
PrintAndLog
(
&
logs
,
fmt
.
Sprintf
(
" %s %d: %s"
,
utils
.
I118Prt
.
Sprintf
(
"checkpoint"
),
cp
.
Numb
,
cpStatus
:=
utils
.
BoolToPass
(
step
.
Status
)
cpStatusColor
:=
colorStatus
(
cpStatus
)
logs
=
append
(
logs
,
fmt
.
Sprintf
(
" %s%d: %s"
,
utils
.
I118Prt
.
Sprintf
(
"checkpoint"
),
cp
.
Numb
,
utils
.
BoolToPass
(
cp
.
Status
)))
fmt
.
Printf
(
" %s%d: %s"
,
utils
.
I118Prt
.
Sprintf
(
"checkpoint"
),
cp
.
Numb
,
cpStatusColor
)
PrintAndLog
(
&
logs
,
fmt
.
Sprintf
(
" %s %s"
,
utils
.
I118Prt
.
Sprintf
(
"expect_result"
),
cp
.
Expect
))
PrintAndLog
(
&
logs
,
fmt
.
Sprintf
(
" %s %s"
,
utils
.
I118Prt
.
Sprintf
(
"actual_result"
),
cp
.
Actual
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录