run.go 668 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
package action

import (
	"fmt"
	"github.com/easysoft/zentaoatf/src/biz"
	. "github.com/easysoft/zentaoatf/src/misc"
	"github.com/easysoft/zentaoatf/src/model"
	. "github.com/easysoft/zentaoatf/src/utils"
)

func Run(scriptDir string, langType string) {
	p := GetInstance() // for test
	p.Printf("HELLO_1", "Peter")
	fmt.Println(p.Sprintf("HELLO_1", "Peter"))

	files, _ := GetAllFiles(scriptDir, langType)

	var report = model.TestReport{Path: scriptDir, Env: GetOs(),
		Pass: 0, Fail: 0, Total: 0, Cases: make([]model.CaseLog, 0)}

	biz.ExeScripts(files, scriptDir, langType, &report)

	biz.CheckResults(scriptDir, langType, &report)
	biz.Print(report, scriptDir)
}