From 50a4ec250fdaa2c7657fc8aea0c50ce639987288 Mon Sep 17 00:00:00 2001 From: Aaron Chen <462826@qq.com> Date: Wed, 4 Sep 2019 10:17:57 +0800 Subject: [PATCH] stdin --- src/action/run.go | 4 ++-- src/atf.go | 2 +- src/service/script/assert.go | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/action/run.go b/src/action/run.go index fe061389..f2559d14 100644 --- a/src/action/run.go +++ b/src/action/run.go @@ -126,7 +126,7 @@ func isRunWithSuiteFile(files []string) (string, string) { if path.Ext(file) == "."+constant.ExtNameSuite { suiteFile = file } else { - if fileUtils.IsDir(file) && dir != "" { // only select the first dir + if fileUtils.IsDir(file) && dir == "" { // only select the first dir dir = file } } @@ -147,7 +147,7 @@ func isRunWithResultFile(files []string) string { var resultFile string for _, file := range files { - if path.Ext(file) == "."+constant.ExtNameResult { + if path.Ext(file) == "."+constant.ExtNameResult || path.Ext(file) == "."+constant.ExtNameJson { resultFile = file return resultFile diff --git a/src/atf.go b/src/atf.go index 558c575e..121a0d9b 100644 --- a/src/atf.go +++ b/src/atf.go @@ -107,7 +107,7 @@ func main() { action.View(files, keywords) } - case "set", "-s": + case "set", "-set": action.InputForSet() case "help", "-h": diff --git a/src/service/script/assert.go b/src/service/script/assert.go index 212b142c..2b724963 100755 --- a/src/service/script/assert.go +++ b/src/service/script/assert.go @@ -137,7 +137,9 @@ func GetFailedCasesDirectlyFromTestResult(resultFile string) []string { json.Unmarshal([]byte(content), &report) for _, cs := range report.Cases { - cases = append(cases, cs.Path) + if cs.Status != "pass" { + cases = append(cases, cs.Path) + } } return cases -- GitLab