提交 2bfb1015 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

test on win7

上级 86677999
......@@ -32,7 +32,7 @@ func ExeScript(file string, langType string, scriptDir string) {
var logFile string
logFile = utils.ScriptToLogName(scriptDir, file)
log.Panic(logFile)
log.Panic(scriptDir)
command = file
startTime := time.Now()
......
......@@ -5,6 +5,7 @@ import (
"github.com/easysoft/zentaoatf/src/model"
"github.com/easysoft/zentaoatf/src/utils"
"github.com/fatih/color"
"os"
"strings"
"time"
)
......@@ -72,5 +73,5 @@ func Print(report model.TestReport, workDir string) {
}
}
utils.WriteFile(workDir+"/"+utils.LogDir+utils.RunDir+"result.txt", strings.Join(logs, "\n"))
utils.WriteFile(workDir+string(os.PathSeparator)+utils.LogDir+utils.RunDir+"result.txt", strings.Join(logs, "\n"))
}
......@@ -2,6 +2,7 @@ package utils
import (
"github.com/easysoft/zentaoatf/src/misc"
"os"
"path"
"regexp"
"runtime"
......@@ -21,7 +22,6 @@ func RemoveBlankLine(str string) string {
func ScriptToLogName(dir string, file string) string {
logDir := dir + LogDir + RunDir
PrintToCmd(logDir)
MkDirIfNeeded(logDir)
nameSuffix := path.Ext(file)
......@@ -29,7 +29,6 @@ func ScriptToLogName(dir string, file string) string {
name := strings.TrimSuffix(nameWithSuffix, nameSuffix)
logFile := logDir + name + ".log"
PrintToCmd(logFile)
return logFile
}
......@@ -43,14 +42,14 @@ func ScriptToExpectName(file string) string {
func PathToRunName(filePath string) string {
if filePath == "" {
return RunMode.String() + "-" + DateTimeStrFmt(time.Now(), "2006-01-02 15:04:05") + "/"
return RunMode.String() + "-" + DateTimeStrFmt(time.Now(), "2006-01-02 15:04:05") + string(os.PathSeparator)
}
name := path.Base(filePath)
ext := path.Ext(filePath)
name = strings.Replace(name, ext, "", -1)
runName := RunMode.String() + "-" + name + "-" + DateTimeStrFmt(time.Now(), "2006-01-02 15:04:05") + "/"
runName := RunMode.String() + "-" + name + "-" + DateTimeStrFmt(time.Now(), "2006-01-02 15:04:05") + string(os.PathSeparator)
return runName
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册