diff --git a/demo/sample/1_simple.php b/demo/sample/1_simple.php index cb60ec44fe5c4f92dceb45cc8c826fff394ccf55..f1225f62e45089c4ef10647754be96fbf3733d67 100755 --- a/demo/sample/1_simple.php +++ b/demo/sample/1_simple.php @@ -12,7 +12,7 @@ step3 >> expect 3 */ -checkStep1() || print("expect 1\n"); +checkStep1() || print("expect 0\n"); checkStep3() || print("expect 3\n"); function checkStep1(){} diff --git a/src/service/testing/unitTestReport.go b/src/service/testing/unitTestReport.go index 7636e45b45a65c7b01272f136234a6226509ca40..d7833417dfcbd83f44d26ad135c12715138f181e 100644 --- a/src/service/testing/unitTestReport.go +++ b/src/service/testing/unitTestReport.go @@ -67,7 +67,9 @@ func GenUnitTestReport(cases []model.UnitResult, classNameMaxWidth int, timeVal postFix = "." } - logUtils.ScreenAndResult("\n" + logUtils.GetWholeLine(time.Now().Format("2006-01-02 15:04:05")+" "+ + logUtils.Result("\n" + logUtils.GetWholeLine(time.Now().Format("2006-01-02 15:04:05")+" "+ + i118Utils.I118Prt.Sprintf("found_scripts", strconv.Itoa(len(cases)))+postFix, "=")) + logUtils.Screen("\n" + logUtils.GetWholeLine(time.Now().Format("2006-01-02 15:04:05")+" "+ i118Utils.I118Prt.Sprintf("found_scripts", color.CyanString(strconv.Itoa(len(cases))))+postFix, "=")) if report.Total == 0 { diff --git a/src/service/testing/ztfExec.go b/src/service/testing/ztfExec.go index cfc9b73bd08e817c7b025ca76120b78a890b8a89..4d432b273c6a36a8da1f6d82827c26a3c3675abb 100644 --- a/src/service/testing/ztfExec.go +++ b/src/service/testing/ztfExec.go @@ -22,12 +22,15 @@ func ExeScripts(casesToRun []string, casesToIgnore []string, report *model.TestR postFix = "." } - msg := now.Format("2006-01-02 15:04:05") + " " + - i118Utils.I118Prt.Sprintf("found_scripts", color.CyanString(strconv.Itoa(len(casesToRun)))) + postFix - logUtils.ScreenAndResult("\n" + logUtils.GetWholeLine(msg, "=")) + logUtils.Result("\n" + logUtils.GetWholeLine(now.Format("2006-01-02 15:04:05")+" "+ + i118Utils.I118Prt.Sprintf("found_scripts", strconv.Itoa(len(casesToRun)))+postFix, "=")) + logUtils.Screen("\n" + logUtils.GetWholeLine(now.Format("2006-01-02 15:04:05")+" "+ + i118Utils.I118Prt.Sprintf("found_scripts", color.CyanString(strconv.Itoa(len(casesToRun))))+postFix, "=")) if len(casesToIgnore) > 0 { - logUtils.ScreenAndResult(" " + + logUtils.Result(" " + + i118Utils.I118Prt.Sprintf("ignore_scripts", strconv.Itoa(len(casesToIgnore))) + postFix) + logUtils.Screen(" " + i118Utils.I118Prt.Sprintf("ignore_scripts", color.CyanString(strconv.Itoa(len(casesToIgnore)))) + postFix) } diff --git a/src/service/testing/ztfTestReport.go b/src/service/testing/ztfTestReport.go index 31825d9a7953e5c41f715e603fac4d5fdc25dbed..b3b6229636a3dd9ab7a6ba8453666469d3aae317 100644 --- a/src/service/testing/ztfTestReport.go +++ b/src/service/testing/ztfTestReport.go @@ -93,7 +93,7 @@ func GenZTFTestReport(report model.TestReport, pathMaxWidth int) { failStr := fmt.Sprintf(fmtStr, report.Fail, float32(report.Fail*100/report.Total), i118Utils.I118Prt.Sprintf("fail")) skipStr := fmt.Sprintf(fmtStr, report.Skip, float32(report.Skip*100/report.Total), i118Utils.I118Prt.Sprintf("skip")) - // 带映带结果文件 + // 打印到结果文件 logUtils.Result("\n" + time.Now().Format("2006-01-02 15:04:05") + " " + i118Utils.I118Prt.Sprintf("run_scripts", report.Total, report.Duration, secTag,