Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
82148b14
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
11 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
82148b14
编写于
8月 27, 2019
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support run with dir suite task result files
上级
04452418
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
9 deletion
+15
-9
src/action/run.go
src/action/run.go
+0
-5
src/utils/file/file.go
src/utils/file/file.go
+15
-4
未找到文件。
src/action/run.go
浏览文件 @
82148b14
...
@@ -10,7 +10,6 @@ import (
...
@@ -10,7 +10,6 @@ import (
logUtils
"github.com/easysoft/zentaoatf/src/utils/log"
logUtils
"github.com/easysoft/zentaoatf/src/utils/log"
"github.com/easysoft/zentaoatf/src/utils/vari"
"github.com/easysoft/zentaoatf/src/utils/vari"
"github.com/fatih/color"
"github.com/fatih/color"
"path"
"path/filepath"
"path/filepath"
"strconv"
"strconv"
)
)
...
@@ -43,10 +42,6 @@ func Run(files []string, suite string, task string, result string) {
...
@@ -43,10 +42,6 @@ func Run(files []string, suite string, task string, result string) {
fileUtils
.
GetScriptByIdsInDir
(
files
[
0
],
caseIdMap
,
&
cases
)
fileUtils
.
GetScriptByIdsInDir
(
files
[
0
],
caseIdMap
,
&
cases
)
}
else
{
// find cases in current dir
}
else
{
// find cases in current dir
for
_
,
file
:=
range
files
{
for
_
,
file
:=
range
files
{
if
!
path
.
IsAbs
(
file
)
{
file
,
_
=
filepath
.
Abs
(
file
)
}
fileUtils
.
GetAllScriptsInDir
(
file
,
&
cases
)
fileUtils
.
GetAllScriptsInDir
(
file
,
&
cases
)
}
}
}
}
...
...
src/utils/file/file.go
浏览文件 @
82148b14
...
@@ -8,6 +8,7 @@ import (
...
@@ -8,6 +8,7 @@ import (
"io/ioutil"
"io/ioutil"
"os"
"os"
"path"
"path"
"path/filepath"
"regexp"
"regexp"
"strconv"
"strconv"
"strings"
"strings"
...
@@ -53,6 +54,11 @@ func FileExist(path string) bool {
...
@@ -53,6 +54,11 @@ func FileExist(path string) bool {
}
}
func
GetAllScriptsInDir
(
dirPth
string
,
files
*
[]
string
)
error
{
func
GetAllScriptsInDir
(
dirPth
string
,
files
*
[]
string
)
error
{
dirPth
=
commonUtils
.
UpdateDir
(
dirPth
)
if
!
path
.
IsAbs
(
dirPth
)
{
dirPth
,
_
=
filepath
.
Abs
(
dirPth
)
}
sep
:=
string
(
os
.
PathSeparator
)
sep
:=
string
(
os
.
PathSeparator
)
dir
,
err
:=
ioutil
.
ReadDir
(
dirPth
)
dir
,
err
:=
ioutil
.
ReadDir
(
dirPth
)
...
@@ -75,10 +81,15 @@ func GetAllScriptsInDir(dirPth string, files *[]string) error {
...
@@ -75,10 +81,15 @@ func GetAllScriptsInDir(dirPth string, files *[]string) error {
return
nil
return
nil
}
}
func
GetScriptByIdsInDir
(
dir
string
,
idMap
map
[
int
]
string
,
files
*
[]
string
)
error
{
func
GetScriptByIdsInDir
(
dirPth
string
,
idMap
map
[
int
]
string
,
files
*
[]
string
)
error
{
dirPth
=
commonUtils
.
UpdateDir
(
dirPth
)
if
!
path
.
IsAbs
(
dirPth
)
{
dirPth
,
_
=
filepath
.
Abs
(
dirPth
)
}
sep
:=
string
(
os
.
PathSeparator
)
sep
:=
string
(
os
.
PathSeparator
)
dir
,
err
:=
ioutil
.
ReadDir
(
dir
)
dir
,
err
:=
ioutil
.
ReadDir
(
dir
Pth
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -86,9 +97,9 @@ func GetScriptByIdsInDir(dir string, idMap map[int]string, files *[]string) erro
...
@@ -86,9 +97,9 @@ func GetScriptByIdsInDir(dir string, idMap map[int]string, files *[]string) erro
for
_
,
fi
:=
range
dir
{
for
_
,
fi
:=
range
dir
{
name
:=
fi
.
Name
()
name
:=
fi
.
Name
()
if
fi
.
IsDir
()
{
// 目录, 递归遍历
if
fi
.
IsDir
()
{
// 目录, 递归遍历
GetAllScriptsInDir
(
dir
+
name
+
sep
,
files
)
GetAllScriptsInDir
(
dir
Pth
+
name
+
sep
,
files
)
}
else
{
}
else
{
path
:=
dir
+
name
path
:=
dir
Pth
+
name
if
CheckFileIsScript
(
path
)
{
if
CheckFileIsScript
(
path
)
{
*
files
=
append
(
*
files
,
path
)
*
files
=
append
(
*
files
,
path
)
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录