提交 537d6ffa 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

run nested test suite file

上级 6bb5cfd4
...@@ -39,3 +39,7 @@ func (c ResultStatus) String() string { ...@@ -39,3 +39,7 @@ func (c ResultStatus) String() string {
} }
return "UNKNOWN" return "UNKNOWN"
} }
const (
SuiteExt string = "suite"
)
package utils package utils
import ( import (
"github.com/easysoft/zentaoatf/src/misc"
"io/ioutil" "io/ioutil"
"os" "os"
"path" "path"
...@@ -90,7 +91,17 @@ func GetSpecifiedFiles(dirPth string, fileNames []string) (files []string, err e ...@@ -90,7 +91,17 @@ func GetSpecifiedFiles(dirPth string, fileNames []string) (files []string, err e
if strings.Index(file, sep) == -1 { if strings.Index(file, sep) == -1 {
file = dirPth + sep + file file = dirPth + sep + file
} }
ret = append(ret, file)
if path.Ext(file) == "."+misc.SuiteExt {
fileList := make([]string, 0)
GetSuiteFiles(dirPth, file, &fileList)
for _, f := range fileList {
ret = append(ret, f)
}
} else {
ret = append(ret, file)
}
} }
return ret, nil return ret, nil
...@@ -127,6 +138,34 @@ func GetFailedFiles(resultFile string) ([]string, string, string, error) { ...@@ -127,6 +138,34 @@ func GetFailedFiles(resultFile string) ([]string, string, string, error) {
return ret, dir, extName, nil return ret, dir, extName, nil
} }
func GetSuiteFiles(dirPth string, name string, fileList *[]string) {
sep := string(os.PathSeparator)
file := name
if strings.Index(file, sep) == -1 {
file = dirPth + sep + file
}
content := ReadFile(file)
for _, line := range strings.Split(content, "\n") {
line := strings.TrimSpace(line)
if line == "" {
return
}
file := line
if strings.Index(file, sep) == -1 {
file = dirPth + sep + file
}
if path.Ext(file) == "."+misc.SuiteExt {
GetSuiteFiles(dirPth, file, fileList)
} else {
*fileList = append(*fileList, file)
}
}
}
func MkDir(dir string) { func MkDir(dir string) {
if !CheckFileIsExist(dir) { if !CheckFileIsExist(dir) {
os.Mkdir(dir, os.ModePerm) os.Mkdir(dir, os.ModePerm)
......
xdoc/scripts/tc-100.php
tc-200.php
xdoc/scripts/tc-300.php
ts-002.suite
\ No newline at end of file
用例-400.php
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册