diff --git a/src/action/run.go b/src/action/run.go index a2653a2729cc654980b9252f5fdce440ba5dc36e..069c290ec846ee54396ac0d279c00b12e5df0bc1 100644 --- a/src/action/run.go +++ b/src/action/run.go @@ -17,7 +17,8 @@ func Run(scriptDir string, fileNames []string, langType string) { LangMap := script.LangMap var files []string - if fileNames != nil && len(fileNames) > 0 { + + if fileNames != nil && len(fileNames) > 0 { // pass a list if len(fileNames) == 1 { if strings.Index(fileNames[0], ".suite") > -1 { utils.RunMode = misc.SUITE @@ -31,7 +32,7 @@ func Run(scriptDir string, fileNames []string, langType string) { } files, _ = utils.GetSpecifiedFiles(scriptDir, fileNames) - } else { + } else { // give a dir files, _ = utils.GetAllFiles(scriptDir, LangMap[langType]["extName"]) utils.RunMode = misc.DIR utils.RunDir = utils.PathToRunName(scriptDir) diff --git a/src/utils/utils.go b/src/utils/utils.go index 29efe4e59334747b2349887d0c0885e4fa26d3a3..ae545e089e2573504e8680c4fe1f23321261c230 100644 --- a/src/utils/utils.go +++ b/src/utils/utils.go @@ -2,6 +2,7 @@ package utils import ( "github.com/easysoft/zentaoatf/src/misc" + "log" "os" "path" "regexp" @@ -48,6 +49,7 @@ func PathToRunName(filePath string) string { name := path.Base(filePath) ext := path.Ext(filePath) name = strings.Replace(name, ext, "", -1) + log.Panic(name) runName := RunMode.String() + "-" + name + "-" + DateTimeStrFmt(time.Now(), "2006-01-02 15:04:05") + string(os.PathSeparator)