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

test on win7

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