提交 7ce72c53 编写于 作者: m0_58228130's avatar m0_58228130

run by all.cs

上级 a670369a
......@@ -14,6 +14,7 @@ import (
"github.com/kataras/iris/v12/websocket"
"path"
"strconv"
"strings"
)
func RunZTFTest(files []string, suiteIdStr, taskIdStr string, actionModule *command.IndexModule) error {
......@@ -40,7 +41,7 @@ func RunZTFTest(files []string, suiteIdStr, taskIdStr string, actionModule *comm
dir = fileUtils.AbsolutePath(".")
}
//cases = getCaseBySuiteFile(suite, dir)
cases = getCaseBySuiteFile(suite, dir)
} else if result != "" { // run from failed result file
//cases = assertUtils.GetFailedCasesDirectlyFromTestResult(result)
} else { // run files
......@@ -121,3 +122,29 @@ func isRunWithResultFile(files []string) string {
return ""
}
func getCaseBySuiteFile(file string, dir string) []string {
caseIdMap := map[int]string{}
cases := make([]string, 0)
GetCaseIdsInSuiteFile(file, &caseIdMap)
scriptUtils.GetScriptByIdsInDir(dir, caseIdMap, &cases)
return cases
}
func GetCaseIdsInSuiteFile(name string, fileIdMap *map[int]string) {
content := fileUtils.ReadFile(name)
for _, line := range strings.Split(content, "\n") {
idStr := strings.TrimSpace(line)
if idStr == "" {
continue
}
id, err := strconv.Atoi(idStr)
if err == nil {
(*fileIdMap)[id] = ""
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册