github.com/turingchain2020/turingchain@v1.1.21/cmd/autotest/main.go (about) 1 // Copyright Turing Corp. 2018 All Rights Reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Package 自动化系统回归测试工具,外部支持输入测试用例配置文件, 6 // 输出测试用例执行结果并记录详细执行日志。 7 // 内部代码支持用例扩展开发,继承并实现通用接口,即可自定义实现用例类型。 8 package main 9 10 import ( 11 "flag" 12 "fmt" 13 "os" 14 15 "github.com/turingchain2020/turingchain/cmd/autotest/testflow" 16 //默认只导入系统dapp的AutoTest 17 _ "github.com/turingchain2020/turingchain/system" 18 ) 19 20 var ( 21 configFile string 22 logFile string 23 ) 24 25 func init() { 26 27 flag.StringVar(&configFile, "f", "autotest.toml", "-f configFile") 28 flag.StringVar(&logFile, "l", "autotest.log", "-l logFile") 29 flag.Parse() 30 } 31 32 func main() { 33 34 testflow.InitFlowConfig(configFile, logFile) 35 36 if testflow.StartAutoTest() { 37 38 fmt.Println("========================================Succeed!============================================") 39 os.Exit(0) 40 } else { 41 fmt.Println("==========================================Failed!============================================") 42 os.Exit(1) 43 } 44 }